Skip to content

Marked.js doesn't parse links in front matter headers correctly #13

@NicolasMassart

Description

@NicolasMassart

Description of the issue

As indicated in tcort/markdown-link-check#128 the parsing of links in front matter YAML is buggy and returns all the characters even after the end of the link, so it includes quotes (as quotes are ok in YAML to delimitate string values).
This seems to be a choice on the Marked.js side not to support this: markedjs/marked#485

Solving leads

We first need to check if latest Marked.js behaves in a better way.

Then there's two options:

  1. exclude the front matter header parsing from Marked.js parsing and parse it separately for links
  2. switch to a parser that handles front matter and would provide the correct result

1st option is clearly the easiest in my opinion as we don't know the effect of switching to a new parser on existing user projects.

Expectations

Markdown-link-extractor is expected to extract for all the links in markdown files including those in a front matter header.

Linked issue

#7 also asks for links to be extracted from html code included in markdown. This is the same kind of request. Maybe both could be handled at the same time?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdependenciesPull requests that update a dependency file

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions