Repository navigation
Render unknown Sink events as raw HTML in MarkdownSink - #1088
Conversation
MarkdownSink silently dropped any Sink event it had no dedicated handling for (e.g. <object>, image maps), taking the content that event carried with it. Emit them as raw HTML instead, mirroring Xhtml5BaseSink, but never self-close a non-void tag: HTML5 ignores a trailing slash on those, which would otherwise swallow all following content (see xdoc-selfclosing-raw-html for the matching parser-side fix).
|
Is the behavior of |
|
Left to the implementor, explicitly.
"emit it as raw text, as a comment, log it" is an explicit grant of latitude, and the existing
This comment was created with AI assistance. |
MarkdownSink.unknown()logged a warning and silently dropped any Sink event it had no dedicated handling for, taking the content it carried with it (e.g.<object>embeds, image maps). It now delegates tag reconstruction toXhtml5BaseSink.unknown()and emits the raw HTML tag instead, restoring that content in the converted output.<thead>/<tbody>/<tfoot>stay excluded, since they carry no content of their own and Doxia's table sink API already captures the structure they wrap.Aligned with #1087 (
xdoc-selfclosing-raw-html): a self-closing, non-void tag (e.g.<object/>) is never rendered self-closed, since HTML5 ignores the trailing slash on non-void elements and would otherwise swallow all following content as fallback children. It is written as an explicitly closed pair instead.Root-cause fix for apache/maven-doxia-converter#159.
Verified: end-to-end conversion of the issue's xdoc fixture (
<object type="image/svg+xml" data="x.svg"/>) through a locally builtdoxia-converternow yields<object type="image/svg+xml" data="x.svg"></object>in the Markdown output instead of silently vanishing.This change was created with AI assistance.