From a305b6872ed294510f818b318caa9949c1c3f102 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Mon, 9 Jul 2018 20:19:49 +0800 Subject: [PATCH] highlighter: support Front Matter for YAML meta data --- src/hgmarkdownhighlighter.cpp | 3 ++- src/resources/themes/v_detorte/v_detorte.mdhl | 3 +++ src/resources/themes/v_moonlight/v_moonlight.mdhl | 3 +++ src/resources/themes/v_native/v_native.mdhl | 3 +++ src/resources/themes/v_pure/v_pure.mdhl | 3 +++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/hgmarkdownhighlighter.cpp b/src/hgmarkdownhighlighter.cpp index 02bcb37d..16cc6e5d 100644 --- a/src/hgmarkdownhighlighter.cpp +++ b/src/hgmarkdownhighlighter.cpp @@ -818,7 +818,8 @@ void HGMarkdownHighlighter::parseInternal() memcpy(content, data, len); 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) diff --git a/src/resources/themes/v_detorte/v_detorte.mdhl b/src/resources/themes/v_detorte/v_detorte.mdhl index 01514166..8a58b20c 100644 --- a/src/resources/themes/v_detorte/v_detorte.mdhl +++ b/src/resources/themes/v_detorte/v_detorte.mdhl @@ -177,3 +177,6 @@ foreground: ccb24c STRIKE foreground: e57373 font-style: strikeout + +FRONTMATTER +foreground: af8787 diff --git a/src/resources/themes/v_moonlight/v_moonlight.mdhl b/src/resources/themes/v_moonlight/v_moonlight.mdhl index f4119ef0..8679de6d 100644 --- a/src/resources/themes/v_moonlight/v_moonlight.mdhl +++ b/src/resources/themes/v_moonlight/v_moonlight.mdhl @@ -176,3 +176,6 @@ foreground: 6e7686 STRIKE foreground: e57373 font-style: strikeout + +FRONTMATTER +foreground: 6e7686 diff --git a/src/resources/themes/v_native/v_native.mdhl b/src/resources/themes/v_native/v_native.mdhl index 0dab987b..0c40ad8b 100644 --- a/src/resources/themes/v_native/v_native.mdhl +++ b/src/resources/themes/v_native/v_native.mdhl @@ -172,3 +172,6 @@ foreground: 00af00 STRIKE foreground: b71c1c font-style: strikeout + +FRONTMATTER +foreground: 6c6c6c diff --git a/src/resources/themes/v_pure/v_pure.mdhl b/src/resources/themes/v_pure/v_pure.mdhl index b8dd96cb..4daa0506 100644 --- a/src/resources/themes/v_pure/v_pure.mdhl +++ b/src/resources/themes/v_pure/v_pure.mdhl @@ -173,3 +173,6 @@ foreground: 00af00 STRIKE foreground: b71c1c font-style: strikeout + +FRONTMATTER +foreground: 6c6c6c