From 7060fccad18bca0f22838a29a16fef740646ee80 Mon Sep 17 00:00:00 2001 From: 2jun0 Date: Tue, 26 Oct 2021 14:41:21 +0900 Subject: [PATCH 1/7] fix: Section scroll error with weird name. --- src/core/event/scroll.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/event/scroll.js b/src/core/event/scroll.js index bd6661918..15e098920 100644 --- a/src/core/event/scroll.js +++ b/src/core/event/scroll.js @@ -147,7 +147,7 @@ export function scrollIntoView(path, id) { return; } const topMargin = config().topMargin; - const section = dom.find('#' + id); + const section = dom.find(`[id='${id}']`); section && scrollTo(section, topMargin); const li = nav[getNavKey(path, id)]; From c24a7f76b3e864b3af78db31f532903cb0bac76a Mon Sep 17 00:00:00 2001 From: 2jun0 Date: Tue, 26 Oct 2021 15:22:44 +0900 Subject: [PATCH 2/7] fix: vue template matching error When only using {{ 1 + 1 }} syntax, It doesn't necessarily have to exists vueGlobalOptions and vueComponents. --- src/core/render/index.js | 115 +++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 59 deletions(-) diff --git a/src/core/render/index.js b/src/core/render/index.js index 9fb777baf..3ffc1ea04 100644 --- a/src/core/render/index.js +++ b/src/core/render/index.js @@ -125,65 +125,62 @@ function renderMain(html) { ); // Template syntax, vueComponents, vueGlobalOptions - if (docsifyConfig.vueGlobalOptions || vueComponentNames.length) { - const reHasBraces = /{{2}[^{}]*}{2}/; - // Matches Vue full and shorthand syntax as attributes in HTML tags. - // - // Full syntax examples: - // v-foo, v-foo[bar], v-foo-bar, v-foo:bar-baz.prop - // - // Shorthand syntax examples: - // @foo, @foo.bar, @foo.bar.baz, @[foo], :foo, :[foo] - // - // Markup examples: - //
{{ html }}
- //
- //
- // - // - // - // + // + // + //