From 063b72772383bf2a449143b91ac7b77285499610 Mon Sep 17 00:00:00 2001 From: hqweay Date: Mon, 27 Jun 2022 21:28:49 +0800 Subject: [PATCH] highlight supports no-latin Language --- _notes/your-first-note.md | 2 ++ _plugins/markdown-highlighter.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/_notes/your-first-note.md b/_notes/your-first-note.md index e7ca5cb..c83b0bf 100644 --- a/_notes/your-first-note.md +++ b/_notes/your-first-note.md @@ -82,6 +82,8 @@ And of course, images look great: You can also ==highlight some content== by wrapping it with `==`. +Non-latin languages are supported too: ==你好==, ==안녕하세요==, ==こんにちは==. + ### Code syntax highlighting You can add code blocks with full syntax color highlighting by wrapping code snippet in triple backticks and specifying the type of the code (`js`, `rb`, `sh`, etc.): diff --git a/_plugins/markdown-highlighter.rb b/_plugins/markdown-highlighter.rb index 6630d00..b14ae84 100644 --- a/_plugins/markdown-highlighter.rb +++ b/_plugins/markdown-highlighter.rb @@ -14,5 +14,5 @@ Jekyll::Hooks.register [:pages], :post_convert do |doc| end def replace(doc) - doc.content.gsub!(/==+(\w(.*?)?[^ .=]?)==+/, "\\1") + doc.content.gsub!(/==+([^ ](.*?)?[^ .=]?)==+/, "\\1") end