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 2023/01/22 09:29:00 UTC

[jira] [Comment Edited] (DOXIA-690) Markdown Parser: Multiline metadata incorrectly rendered

    [ https://issues.apache.org/jira/browse/DOXIA-690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17679520#comment-17679520 ] 

Konrad Windszus edited comment on DOXIA-690 at 1/22/23 9:28 AM:
----------------------------------------------------------------

APT renders multiline author metadata as 
{code}
 <meta name="author" content="Brett Porter
Jason van Zyl" />
{code}
but probably rendering just one author meta author element per line is more correct (according to https://html.spec.whatwg.org/multipage/semantics.html#standard-metadata-names).

I think the regex based pattern to match both metadata styles (YAML Front Matter and classical Multimarkdown Metadata) does not really work, therefore for YAML Front Matter one should rather leverage the parser from https://github.com/vsch/flexmark-java/tree/master/flexmark-ext-yaml-front-matter and adjust the regex based parsing to Multimarkdown metadata only as that is not natively supported by Flexmark.


was (Author: kwin):
APT renders multiline author metadata as 
{code}
 <meta name="author" content="Brett Porter
Jason van Zyl" />
{code}
but probably rendering just one author meta author element per line is more correct (according to https://html.spec.whatwg.org/multipage/semantics.html#standard-metadata-names).

> Markdown Parser: Multiline metadata incorrectly rendered
> --------------------------------------------------------
>
>                 Key: DOXIA-690
>                 URL: https://issues.apache.org/jira/browse/DOXIA-690
>             Project: Maven Doxia
>          Issue Type: Bug
>          Components: Module - Markdown
>            Reporter: Konrad Windszus
>            Priority: Major
>
> Markdown uses the following metadata format: [http://fletcher.github.io/MultiMarkdown-5/metadata.html]
> In case a metadata key has multiple values on multiple lines it might be emitted as following from the {{MarkdownSink}}:
> {code:java}
> title: Guide to creating a site
> author: Brett Porter
> Jason van Zyl
> date: 2015-07-18 {code}
> That leads to incorrect XHTML output as the second line for {{author}} is not detected correctly and instead of being emitted as metadata is emitted as regular paragraph in the HTML body. This is due to https://github.com/apache/maven-doxia/blob/7509feb03af4d4fb7d48b4f9ef38ff5c1a17a149/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java#L110 only detecting single line metadata values.
> Although this might be a glitch of the underlying Markdown Parser implementation the metadata format explicitly recommends:
> {quote}
>  To keep multiline metadata values from being confused with additional metadata, I recommend indenting each new line of metadata. If your metadata value includes a colon, it must be indented to keep it from being treated as a new key-value pair
> {quote}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)