Last modified: 2013-12-18 05:24:34 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T33146, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31146 - Replace colons by em spaces at the beginning of verses inside poem tag
Replace colons by em spaces at the beginning of verses inside poem tag
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Poem (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-24 23:41 UTC by Zaran
Modified: 2013-12-18 05:24 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch to add colon replacement at the beginning of verses (801 bytes, patch)
2011-09-24 23:41 UTC, Zaran
Details
second proposal for the colon problem (993 bytes, patch)
2011-10-01 10:05 UTC, Zaran
Details

Description Zaran 2011-09-24 23:41:33 UTC
Created attachment 9096 [details]
Patch to add colon replacement at the beginning of verses

In wikisource where the poem extension is mainly used, it has become common practice to use one or several colons at the beginning of indented verses. This is the most practical solution to get em spaces (the typographic rule is to indent shortest verses by one em space for each missing foot compared to the longest verse). However, the html generated code is really ugly in those cases : sometimes up to 5 or 6 nested definition lists.

My solution : inside the poem tag, replace the colons at the beginning of each line by em spaces: &amps;emsp;. The result will be  the same for the reader, but the underlying html code will be much cleaner.

Patch enclosed.
Comment 1 Brion Vibber 2011-09-26 18:10:40 UTC
This would render very differently in the case of line wrapping: when using the standard wiki indentation (implemented with dl/dd) a wrapped line's second line will also be indented, whereas when implementing by putting non-collapsable spaces at the beginning of the line, no such indentation will be carried on to the wrapped line.

What would be the actual intended case for how that should look and behave?

(Appearance and behavior is what's important, not the attractiveness of the HTML, though it's nice to have clean code and nicer to have cleanly stylable code.)
Comment 2 Zaran 2011-10-01 10:04:26 UTC
The problem of line-wrapping is indeed a legitimate concern, however, please note that i only intend to change the behavior of colons inside the poem tag. In this case, it's hard to tell what should be the correct indentation after a line-wrap: if you carry on the indentation, the wrapped line might be mistaken for a new verse.

In wikisource, verses are sometimes indented using simple spaces. This also does not indent the second part of wrapped verses.

I don't think that the appearance of the HTML code is important. My concern is about accessibility and is twofold:
* the current solution is semantically incorrect: an indented verse is not a definition list, it's just a verse which is indented. Furthermore, when the indentation starts, the preceding paragraph is closed and a definition list starts, as if it was a break in the stanza
* screen readers for visually impaired persons: nested definition lists is not easily understandable for such readers

I propose a second patch which has the same visual effect as definition lists, without the downside of nesting them and semantically more correct (it just encapsulate the indented verse inside a span tag). 

You can find a comparison between the normal behavior and my two patches on my user page: http://fr.wikisource.org/wiki/Utilisateur:Zaran/Po%C3%A8me

Finally, note that there is no firm rule stating how wrapped verses should be rendered. The best solution is always to chose a sufficient text width. In this case, both of my patches are improvements to the current situation.
Comment 3 Zaran 2011-10-01 10:05:38 UTC
Created attachment 9136 [details]
second proposal for the colon problem
Comment 4 Brion Vibber 2011-10-05 22:17:32 UTC
Just noting that bug 4521 asks more generally for making the :-as-indentation more semantically nice; I don't seem much of a difference between the general and the <poem> case.
Comment 5 Sumana Harihareswara 2011-11-14 16:55:55 UTC
Thanks for the patch, Zaran.  It seems to me that it still awaits code review, so I am marking this bug as such.  But do you perhaps have a response to Brion's comment 4 ?
Comment 6 Zaran 2011-11-16 01:16:34 UTC
Thanks Sumana for the feedback. I wasn't aware of bug 4521 until Brion's comment. I think bug 4521 is an interesting discussion which could hopefully lead to a solution to a more general problem : colons are often use inappropriately, which results in a heavy inaccessible code. While I wholeheartedly support bug 4521, I still reckon that the poem extension needs an easy way to insert em spaces at the beginning of verses, the same way that spaces at the beginning of verses at converting into non-breaking spaces. Maybe a character other than colons should be used for em spaces. I suggest using > (greater than). If you think that is a good idea, I will adapt the patch.
Comment 7 Sumana Harihareswara 2012-06-11 18:44:30 UTC
Zaran, I don't know -- maybe you should ask other users of the Poem extension, via a few of the Village Pumps?
Comment 8 Ryan Kaldari 2012-06-29 20:53:38 UTC
Patch checked in as https://gerrit.wikimedia.org/r/#/c/13539/. Awaiting code review.
Comment 9 Ryan Kaldari 2012-06-29 21:05:31 UTC
Zaran: Is it OK it list your email address publicly in the file header?
Comment 10 Krinkle 2012-06-30 04:29:43 UTC
So, should the content after the line-wrap be indented as well or not?

Generally when reading professional text, I see that only the first line of the paragraph is indented. I don't know if this is the same grammatical context or not. But having an answer to that would make reviewing the change easier I suppose.
Comment 11 Ryan Kaldari 2012-06-30 04:37:40 UTC
I imagine that an editor using a colon to indent a section is going to expect the regular behavior of a colon—in which line-wrapped content is also indented. An editor that wants only the non-wrapped content indented can use spaces.
Comment 12 Ryan Kaldari 2012-09-10 17:15:28 UTC
Merged on sept. 8.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links