Uploaded image for project: 'Maven Doxia'
  1. Maven Doxia
  2. DOXIA-690

Markdown Parser: Multiline metadata incorrectly rendered

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-M6, 2.0.0
    • Module - Markdown
    • None

    Description

      Markdown uses the following metadata format in its sink: http://fletcher.github.io/MultiMarkdown-5/metadata.html.

      In case a metadata key has multiple values on multiple lines it is emitted as following from the MarkdownSink:

      title: Guide to creating a site
      author: Brett Porter
      Jason van Zyl
      date: 2015-07-18 

      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:

      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

      Attachments

        Issue Links

          Activity

            People

              kwin Konrad Windszus
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: