From b3d9b966dfbb6f456c2c457da1d2a366e85d9190 Mon Sep 17 00:00:00 2001 From: Koy <369491420@qq.com> Date: Fri, 14 Feb 2020 15:21:07 +0800 Subject: [PATCH] fix: emojis in titles not working correctly and update (#1016) the doc(add a note) --- docs/helpers.md | 2 ++ src/core/render/compiler.js | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/helpers.md b/docs/helpers.md index 7d551c53..83c59784 100644 --- a/docs/helpers.md +++ b/docs/helpers.md @@ -2,6 +2,8 @@ docsify extends Markdown syntax to make your documents more readable. +> Note: For the special code syntax cases, you'd better put them within a code backticks to avoid any conflicting from configurations or emojis. + ## important content Important content like: diff --git a/src/core/render/compiler.js b/src/core/render/compiler.js index 26f4cea9..60602f1a 100644 --- a/src/core/render/compiler.js +++ b/src/core/render/compiler.js @@ -21,9 +21,12 @@ export function getAndRemoveConfig(str = '') { str = str .replace(/^'/, '') .replace(/'$/, '') - .replace(/(?:^|\s):([\w-]+)=?([\w-]+)?/g, (m, key, value) => { - config[key] = (value && value.replace(/"/g, '')) || true - return '' + .replace(/(?:^|\s):([\w-]+:?)=?([\w-]+)?/g, (m, key, value) => { + if(key.indexOf(':') === -1){ + config[key] = (value && value.replace(/"/g, '')) || true + return '' + } + return m }) .trim() }