maven-doxia icon indicating copy to clipboard operation
maven-doxia copied to clipboard

Links inside HTML blocks are not properly emitted

Open kwin opened this issue 1 month ago • 0 comments

Affected version

2.0.0

Bug description

Currently these Sink events are not properly handled by the MarkdownSink:

sink.definitionList();
sink.definedTerm();
sink.text("question1");
sink.definedTerm_();
sink.definition();
sink.link("#top");
sink.text("[top]"); 
sink.link_();
sink.definition_();
sink.definitionList_();

This leads to the incorrect Markdown

<dl>
<dt>question1</dt>
<dd>[[top]](#top)</dd>
</dl>

The link must be either emitted as <a> tag or the surrounding HTML block of <dd> must be closed with an empty line (which would lead to an additional paragraph <p> being emitted inside the <dd>)

https://daringfireball.net/projects/markdown/syntax#html states that

Note that Markdown formatting syntax is not processed within block-level HTML tags.

and

Unlike block-level HTML tags, Markdown syntax is processed within span-level tags.

In https://spec.commonmark.org/0.31.2/#html-blocks it is similar

kwin avatar Nov 04 '25 15:11 kwin