Skip to content

[plugin] Idea: Support YAML front matter in Markdown files  #2391

@gregives

Description

@gregives

It's common to include YAML front matter at the top of a Markdown file, for example when using Jekyll. Currently, highlight.js parses the last line of YAML as a second-level heading because of the --- three dashes below it. Although YAML front matter isn't actually part of any Markdown specification, would it be possible to add this to the Markdown definition?

GitHub highlights this correctly:

---
title: Example Title
date: 2020-02-05
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Highlight.js highlights this incorrectly:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    languagepluginSpecific plugin or plugin discussion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions