Page MenuHomePhabricator

More semantics in output HTML
Open, Needs TriagePublic

Description

It would be great to have the Poem extension add some more semantic CSS selectors to the HTML it outputs.
Currently, according to the extension documentation says:

  • All newlines are preserved by converting them into <br /> tags
  • The block of text is enclosed in <p></p> tags (as well as a div of class "poem")

It would be great to have:

  • each line (followed in wikitext by single newline) in its own <p> element, with a class "verse", instead of using the less semantic <br />
  • blocks of lines (i.e verses, followed in wikitext by double newline) grouped together in a <div> with a class "stanza"
  • the whole block of poem (i.e. the groups of stanzas) grouped in a <div> with class "poem" (as currently is)

This would enable for finer formatting, such as adding separators between stanzas, as well as tricks such as alternating line colours, or line numbering, in addition to being more semantic.

Event Timeline

ahmad created this task.Jul 9 2018, 8:52 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 9 2018, 8:52 AM
ahmad renamed this task from More semantics to output HTML to More semantics in output HTML.Feb 26 2019, 9:23 PM
ahmad updated the task description. (Show Details)