This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import prettier from 'prettier'; | |
| import babelParser from 'prettier/plugins/babel'; | |
| import htmlParser from 'prettier/plugins/html'; | |
| const frontmatterRegex = /^---js\n([\s\S]*?)\n---\n/; | |
| function parse(text, options) { | |
| const match = text.match(frontmatterRegex); | |
| if (match) { | |
| const frontmatter = match[1]; | |
| const content = text.slice(match[0].length); |
OlderNewer