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

Markdown writer does not properly escape list-item-look-alikes #3492

Closed
nichtich opened this issue Mar 6, 2017 · 2 comments
Closed

Markdown writer does not properly escape list-item-look-alikes #3492

nichtich opened this issue Mar 6, 2017 · 2 comments

Comments

@nichtich
Copy link
Contributor

nichtich commented Mar 6, 2017

This is a follow up from more general issue #1685. Given this example.md:

---
test: '1\. inline'
...

1\. inline

Parsed and written back as Markdown (tested with pandoc 1.19.2.1.):

pandoc example.md -t markdown -s

Results in this document:

---
test: '1. inline'
---

1\. inline

Escaping is done properly in the document body but not in the document metadata.

@jgm
Copy link
Owner

jgm commented Mar 6, 2017

I see why it's doing this, but it's not an easy thing to fix.

The rule that gives us the \. in the body is a special-case rule on Para. If a Para block begins with something that could start an ordered list, we insert the extra backslash.

In the metadata, we don't have a Para; we have a MetaInlines element.

Pandoc (Meta {unMeta = fromList [("test",MetaInlines [Str "1.",Space,Str "inline"])]})

But the Markdown writer can't special-case this, since it doesn't see the MetaInlines; it just gets passed a list of inline elements.

@jgm
Copy link
Owner

jgm commented Mar 6, 2017

Actually it turned out to have a simple fix, and this also dealt with the linked issue (where you don't explicitly escape the period in the title field).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants