Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chrispy-snps opened this issue Nov 18, 2024 · 0 comments

Comments

@chrispy-snps
Copy link

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant