Skip to content

Literal colon (:) characters in YAML metadata block field names are parsed incorrectly #232

Open
@chrispy-snps

Description

@chrispy-snps

In our Markdown files, we use colon-delimited prefixes to indicate metadata fields specific to certain content processing subsystems.

If I have a Markdown input file with a YAML metadata block as follows:

---
title: My Document
myapp:status: published
myapp:label: abc=123
---

# My Document

This is a document.

and I publish this to DITA (just to see how the metadata is converted):

dita -i topic.md -f dita

the resulting DITA is as follows:

<topic id="my-document">
  <title>My Document</title>
  <prolog>
    <data name="myapp" value="label: abc=123"/>
     <!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
    <data name="title" value="My Document"/>
  </prolog>
  <body>
    <p>This is a document.</p>
  </body>
</topic>

The literal colon (:) characters in the YAML field names are incorrectly interpreted as separators. If this same input file is processed through pandoc:

pandoc -s topic.md -o topic-NEW.md

then the fields are parsed and preserved correctly:

---
myapp:label: abc=123
myapp:status: published
title: My Document
---

# My Document

This is a document.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions