0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00

Merge pull request #463 from logto-io/charles-update-code-comments

chore(console): update code comments in markdown util
This commit is contained in:
Charles Zhao 2022-03-29 18:07:41 +08:00 committed by GitHub
commit e297dcbb33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,7 @@ export const parseMarkdownWithYamlFrontmatter = <T extends Record<string, string
const metaRegExp = new RegExp(/^---[\n\r](((?!---).|[\n\r])*)[\n\r]---$/m); const metaRegExp = new RegExp(/^---[\n\r](((?!---).|[\n\r])*)[\n\r]---$/m);
// "rawYamlHeader" is the full matching string, including the --- and --- // "rawYamlHeader" is the full matching string, including the --- and ---
// "metadata" is the first capturing group, which is the string between the --- and --- // "yamlVariables" is the first capturing group, which is the string between the --- and ---
const [rawYamlHeader, yamlVariables] = metaRegExp.exec(markdown) ?? []; const [rawYamlHeader, yamlVariables] = metaRegExp.exec(markdown) ?? [];
if (!rawYamlHeader || !yamlVariables) { if (!rawYamlHeader || !yamlVariables) {