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) \n[main] Tagging system for Trac.\n

\n

\nAssociating resources with tags is easy, faceted content classification.\n

\n

\nAvailable components are marked according to their relevance as follows:\n

[main]
provide core with a generic tagging engine as well as support\nfor common realms \'ticket\' (TracTickets?) and \'wiki\' (TracWiki?).\n
[opt]
add more features to improve user experience and maintenance\n
[extra]
enable advanced features for specific use cases\n
\nMake sure to understand their purpose before deactivating [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

\n

Associating resources with tags is easy, faceted content classification.\n

\n

Available components are marked according to their relevance as follows:

[main]
provide core with a generic tagging engine as well as support\nfor common realms \'ticket\' (TracTickets?) and \'wiki\' (TracWiki?).\n
[opt]
add more features to improve user experience and maintenance\n
[extra]
enable advanced features for specific use cases\n
Make sure to understand their purpose before deactivating [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:

[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.

}}}",defect,closed,normal,1.2.1,wiki system,,normal,fixed,,,,Fix invalid xhtml being generated for definition list after paragraph.,,