You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2025/01/05 10:49:00 UTC
[jira] [Comment Edited] (DOXIA-767) Clarify block vs inline semantics with regards to whitespaces in Sink API
[ https://issues.apache.org/jira/browse/DOXIA-767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17909864#comment-17909864 ]
Konrad Windszus edited comment on DOXIA-767 at 1/5/25 10:48 AM:
----------------------------------------------------------------
It seems also that newlines within {{Sink.text(String text)}} are not properly escaped in all Sinks. In order to make them appear as newlines in HTML one has to use {{<br>}} or backslash at the end of a line for Markdown, however this is not the case in https://github.com/apache/maven-doxia/blob/99e7e1fc420f16941ca6c61720e8bc2549f2f563/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java#L1460. Similarly newlines in HTML text need to be converted to spaces in https://github.com/apache/maven-doxia/blob/99e7e1fc420f16941ca6c61720e8bc2549f2f563/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java#L474 (which isn't the case for XHTML at least).
[~michael-o] What do you think about cleanup here? Right now the semantics is incorrect or at least too fuzzy in the Sink API from my PoV...
was (Author: kwin):
It seems also that newlines within {{Sink.text(String text)}} are not properly escaped in all Sinks. In order to make them appear as newlines in HTML one has to use {{<br>}} or {{\}} for Markdown, however this is not the case in https://github.com/apache/maven-doxia/blob/99e7e1fc420f16941ca6c61720e8bc2549f2f563/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java#L1460. Similarly newlines in HTML text need to be converted to spaces in https://github.com/apache/maven-doxia/blob/99e7e1fc420f16941ca6c61720e8bc2549f2f563/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java#L474 (which isn't the case for XHTML at least).
> Clarify block vs inline semantics with regards to whitespaces in Sink API
> -------------------------------------------------------------------------
>
> Key: DOXIA-767
> URL: https://issues.apache.org/jira/browse/DOXIA-767
> Project: Maven Doxia
> Issue Type: Task
> Components: Documentation
> Reporter: Konrad Windszus
> Priority: Major
>
> The javadoc of https://maven.apache.org/doxia/doxia/doxia-sink-api/apidocs/org/apache/maven/doxia/sink/Sink.html should be clarified with regards to trimming whitespace behaviour for block/inline elements. Not necessarily each block Sink element is a block element in the desired output format (e.g. XHTML). Most prominently this is the case with
> {{Sink.verbatim(Decoration:source)}} which is a block element in Sink API but opens an inline element ({{<pre><code>}}) in XHTML.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)