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

Support markdown front matter #2115

Closed
RunDevelopment opened this issue Nov 17, 2019 · 3 comments · Fixed by #2634
Closed

Support markdown front matter #2115

RunDevelopment opened this issue Nov 17, 2019 · 3 comments · Fixed by #2634

Comments

@RunDevelopment
Copy link
Member

Motivation
When highlighting GitHub's issue or PR templates or markdown files for Jekyll, the meta info about those files isn't highlighted.

Description
Front matter is a short section of meta-information in YAML (or similar languages) about a file and usually looks like this:

---
layout: post
title: Blogging Like a Hacker
---

For now, it should be enough to support YAML front matter as that seems to be the most common.

@mantou132
Copy link

import fm from 'front-matter';

const { frontmatter, body } = fm(md);

const resultCode = Prism.highlight(frontmatter, Prism.languages['yaml'], 'yaml') + Prism.highlight(body, Prism.languages['md'], 'md')

@mantou132
Copy link

When will it be published to npm?

@RunDevelopment
Copy link
Member Author

Next release will be in January.

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

Successfully merging a pull request may close this issue.

2 participants