id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,branch,changelog,apichanges,internalchanges
12638,format_to_html generates invalid HTML for definition list,Ryan J Ollos,Jun Omae,"Discussed in th:#12056, I found that the HTML generated by `format_to_html` is incorrect:
{{{#!pycon
>>> from trac.test import EnvironmentStub, MockRequest
>>> from trac.wiki.formatter import format_to_html
>>> from trac.web.chrome import web_context
>>> env = EnvironmentStub()
>>> req = MockRequest(env)
>>> context = web_context(req)
>>> markup = """"""[main] Tagging system for Trac.
...
... Associating resources with tags is easy, faceted content classification.
...
... Available components are marked according to their relevance as follows:
... `[main]`:: provide core with a generic tagging engine as well as support
... for common realms 'ticket' (TracTickets) and 'wiki' (TracWiki).
... `[opt]`:: add more features to improve user experience and maintenance
... `[extra]`:: enable advanced features for specific use cases
... Make sure to understand their purpose before deactivating `[main]` or
... activating `[extra]` components.
... """"""
>>> format_to_html(env, context, markup)
\nAssociating resources with tags is easy, faceted content classification.\n
\n\nAvailable components are marked according to their relevance as follows:\n
[main]
[opt]
[extra]
[main]
or\nactivating [extra]
components.\n\n'>
}}}
Here's the output formatted by selectively decoding newlines to emphasize the issue:
{{{#!text/html
\n[main] Tagging system for Trac.\n
\nAssociating resources with tags is easy, faceted content classification.\n
\nAvailable components are marked according to their relevance as follows:
[main]
[opt]
[extra]
[main]
or activating [extra]
components.
}}}
The `dl` is wrapped in `p`.
Chrome and Firefox seem to handle the scenario okay by removing the `p` that wraps the `dl`:
{{{#!text/html
Available components are marked according to their relevance as follows: