highlighter: support Front Matter for YAML meta data

This commit is contained in:
Le Tan 2018-07-09 20:19:49 +08:00
parent 5b681dd64c
commit a305b6872e
5 changed files with 14 additions and 1 deletions

View File

@ -818,7 +818,8 @@ void HGMarkdownHighlighter::parseInternal()
memcpy(content, data, len); memcpy(content, data, len);
content[len] = '\0'; content[len] = '\0';
pmh_markdown_to_elements(content, pmh_EXT_STRIKE, &result); int exts = pmh_EXT_STRIKE | pmh_EXT_FRONTMATTER;
pmh_markdown_to_elements(content, exts, &result);
} }
void HGMarkdownHighlighter::handleContentChange(int /* position */, int charsRemoved, int charsAdded) void HGMarkdownHighlighter::handleContentChange(int /* position */, int charsRemoved, int charsAdded)

View File

@ -177,3 +177,6 @@ foreground: ccb24c
STRIKE STRIKE
foreground: e57373 foreground: e57373
font-style: strikeout font-style: strikeout
FRONTMATTER
foreground: af8787

View File

@ -176,3 +176,6 @@ foreground: 6e7686
STRIKE STRIKE
foreground: e57373 foreground: e57373
font-style: strikeout font-style: strikeout
FRONTMATTER
foreground: 6e7686

View File

@ -172,3 +172,6 @@ foreground: 00af00
STRIKE STRIKE
foreground: b71c1c foreground: b71c1c
font-style: strikeout font-style: strikeout
FRONTMATTER
foreground: 6c6c6c

View File

@ -173,3 +173,6 @@ foreground: 00af00
STRIKE STRIKE
foreground: b71c1c foreground: b71c1c
font-style: strikeout font-style: strikeout
FRONTMATTER
foreground: 6c6c6c