Skip to content

Overgreedy regex in metadata extra #234

@davidlowryduda

Description

@davidlowryduda

In the "metadata" extra, we can introduce metadata by beginning with a fenced key-value block. However, consider the following short sample.markdown document.

---
Title: TITLE
Etc: ETC
---

More can be found at [some site][1].

[1]: http://www.google.com

The current regex looks for key: value pairs and gobbles them. Here, it also gobbles [1]: http://www.google.com and everything in between. That is, using something like

python markdown2.py --extras metadata sample.markdown

produces only the empty document

<p></p>

I'm currently writing a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions