slachiewicz opened a new issue, #1127: URL: https://github.com/apache/maven-doxia/issues/1127
### Affected version 2.2.0 and master ### Bug description `XdocSink` writes the title of a level 1 or level 2 section into the `name` attribute of `<section>` or `<subsection>`. [`onSection`](https://github.com/apache/maven-doxia/blob/master/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java#L241) opens the attribute and [`onSectionTitle_`](https://github.com/apache/maven-doxia/blob/master/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java#L310) closes it, and every event in between writes into it. Text is escaped, but inline events such as `bold()` or `link()` write their tags, so the output is not well-formed XML. These events: ```java sink.body(); sink.section1(); sink.sectionTitle1(); sink.text("Use "); sink.bold(); sink.text("mvn"); sink.bold_(); sink.text(" & "); sink.link("http://example.com/"); sink.text("more"); sink.link_(); sink.sectionTitle1_(); sink.paragraph(); sink.text("x"); sink.paragraph_(); sink.section1_(); sink.body_(); ``` produce: ```xml <body><section name="Use <b>mvn</b> & <a href="http://example.com/">more</a>"> <p>x</p></section></body> ``` Any source with markup in a top-level heading hits it when converted to XDoc, for example a Markdown heading `# Use **mvn**`. An attribute can only hold text, so the sink should drop the markup of inline events inside a level 1 or level 2 title and keep their text. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
