[ https://issues.apache.org/jira/browse/DOXIA-764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17907696#comment-17907696 ]
Konrad Windszus commented on DOXIA-764: --------------------------------------- The {{<pre>}} element has special semantics {quote} In the HTML syntax, a leading newline character immediately following the pre element start tag is stripped. {quote} (https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element) This used to kick in prior DOXIA-731, but afterwards no longer. Therefore leading newlines should be removed manually by the Xhtml5BaseSink to imitate the pre DOXIA-731 newline behaviour. > XDoc source has a spurious new line at the beginning > ---------------------------------------------------- > > Key: DOXIA-764 > URL: https://issues.apache.org/jira/browse/DOXIA-764 > Project: Maven Doxia > Issue Type: Bug > Components: Module - Xdoc > Affects Versions: 2.0.0 > Reporter: Konrad Windszus > Assignee: Konrad Windszus > Priority: Major > > HTML rendered from the following XDoc snippet > {code} > <source> > sink.paragraph(); > sink.text( "my text" ); > sink.paragraph_(); </source> > {code} > has a spurious new line at the beginning when rendered as HTML: > {code} > <pre class="prettyprint linenums"><code> > sink.paragraph(); > sink.text( "my text" ); > sink.paragraph_(); </code></pre> > {code} > Probably a regression of DOXIA-731. > Previously this was converted to > {code} > <div class="source"><pre class="prettyprint linenums"> > sink.paragraph(); > sink.text( "my text" ); > sink.paragraph_(); </pre></div> > {code} > where the first linebreak inside {{pre}} was ignored as it is a block element. -- This message was sent by Atlassian Jira (v8.20.10#820010)