Page MenuHomePhabricator

More semantics in output HTML
Open, Needs TriagePublic


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.