From 631e9248786f87a5b2f7892fc73a53543744d288 Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Tue, 1 Feb 2022 08:32:07 -0600 Subject: [PATCH 01/14] Add try/catch w/ error message to plugin calls --- src/core/init/lifecycle.js | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/core/init/lifecycle.js b/src/core/init/lifecycle.js index c04fc1a72..cb2d967b4 100644 --- a/src/core/init/lifecycle.js +++ b/src/core/init/lifecycle.js @@ -36,14 +36,29 @@ export function Lifecycle(Base) { if (index >= queue.length) { next(data); } else if (typeof hookFn === 'function') { + const errTitle = `Docsify plugin ${ + hookFn.name ? '"' + hookFn.name + '"' : '' + } error (${hookName})`; + if (hookFn.length === 2) { - hookFn(data, result => { - data = result; - step(index + 1); - }); + try { + hookFn(data, result => { + data = result; + }); + } catch (err) { + console.error(errTitle, err); + } + step(index + 1); } else { - const result = hookFn(data); - data = result === undefined ? data : result; + let result; + + try { + result = hookFn(data); + } catch (err) { + console.error(errTitle, err); + } + + data = result || data; step(index + 1); } } else { From 67c5410b049237887811350f38e3f9bc8a2c78dc Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Wed, 2 Feb 2022 18:00:46 -0600 Subject: [PATCH 02/14] Update lifecycle.js --- src/core/init/lifecycle.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/core/init/lifecycle.js b/src/core/init/lifecycle.js index cb2d967b4..22906494a 100644 --- a/src/core/init/lifecycle.js +++ b/src/core/init/lifecycle.js @@ -36,29 +36,26 @@ export function Lifecycle(Base) { if (index >= queue.length) { next(data); } else if (typeof hookFn === 'function') { - const errTitle = `Docsify plugin ${ - hookFn.name ? '"' + hookFn.name + '"' : '' - } error (${hookName})`; + const errTitle = `Docsify plugin error (${hookName})`; if (hookFn.length === 2) { try { hookFn(data, result => { data = result; + step(index + 1); }); } catch (err) { console.error(errTitle, err); } - step(index + 1); } else { - let result; - try { - result = hookFn(data); + const result = hookFn(data); + + data = result === undefined ? data : data; } catch (err) { console.error(errTitle, err); } - data = result || data; step(index + 1); } } else { From 2a58be69eb75a87b74d0408765e1d222282ac95b Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Wed, 2 Feb 2022 18:45:26 -0600 Subject: [PATCH 03/14] Update lifecycle.js --- src/core/init/lifecycle.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/init/lifecycle.js b/src/core/init/lifecycle.js index 22906494a..895216c23 100644 --- a/src/core/init/lifecycle.js +++ b/src/core/init/lifecycle.js @@ -42,11 +42,12 @@ export function Lifecycle(Base) { try { hookFn(data, result => { data = result; - step(index + 1); }); } catch (err) { console.error(errTitle, err); } + + step(index + 1); } else { try { const result = hookFn(data); From b61fa152ae501717cf17191be526a2717fea18c9 Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Wed, 2 Feb 2022 23:33:27 -0600 Subject: [PATCH 04/14] Fix docsify-plugin-carbon error --- docs/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.html b/docs/index.html index de3ce2663..edd495d53 100644 --- a/docs/index.html +++ b/docs/index.html @@ -55,7 +55,7 @@
Loading ...
- + From ddaf98ff02290ca4793fb191a1f6e9f736fb1867 Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Wed, 2 Feb 2022 23:38:54 -0600 Subject: [PATCH 07/14] Fix styles in legacy browser w/o CSS var support --- src/themes/basic/_coverpage.styl | 5 +++++ src/themes/basic/_layout.styl | 8 ++++++++ src/themes/buble.styl | 2 ++ src/themes/dark.styl | 5 +++++ src/themes/dolphin.styl | 7 ++++++- src/themes/vue.styl | 5 +++++ 6 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/themes/basic/_coverpage.styl b/src/themes/basic/_coverpage.styl index 19ba80666..c3b402654 100644 --- a/src/themes/basic/_coverpage.styl +++ b/src/themes/basic/_coverpage.styl @@ -63,11 +63,13 @@ section.cover padding 0 .cover-main > p:last-child a + border-color $color-primary border-color var(--theme-color, $color-primary) border-radius 2rem border-style solid border-width 1px box-sizing border-box + color $color-primary color var(--theme-color, $color-primary) display inline-block font-size 1.05rem @@ -78,6 +80,7 @@ section.cover transition all 0.15s ease &:last-child + background-color $color-primary background-color var(--theme-color, $color-primary) color #fff @@ -89,8 +92,10 @@ section.cover color inherit blockquote > p > a + border-bottom 2px solid $color-primary border-bottom 2px solid var(--theme-color, $color-primary) transition color 0.3s &:hover + color $color-primary color var(--theme-color, $color-primary) diff --git a/src/themes/basic/_layout.styl b/src/themes/basic/_layout.styl index 15b6464fb..c14ce685e 100644 --- a/src/themes/basic/_layout.styl +++ b/src/themes/basic/_layout.styl @@ -26,6 +26,7 @@ div#app vertical-align middle .progress + background-color $color-primary background-color var(--theme-color, $color-primary) height 2px left 0px @@ -37,9 +38,11 @@ div#app z-index 999999 .search a:hover + color $color-primary color var(--theme-color, $color-primary) .search .search-keyword + color $color-primary color var(--theme-color, $color-primary) font-style normal font-weight bold @@ -108,10 +111,13 @@ li input[type='checkbox'] transition color 0.3s &:hover + color $color-primary color var(--theme-color, $color-primary) &.active + border-bottom 2px solid $color-primary border-bottom 2px solid var(--theme-color, $color-primary) + color $color-primary color var(--theme-color, $color-primary) /* navbar dropdown */ @@ -172,6 +178,7 @@ li input[type='checkbox'] svg color $color-bg + fill $color-primary fill var(--theme-color, $color-primary) height 80px width 80px @@ -284,6 +291,7 @@ main.hidden opacity 0.4 span + background-color $color-primary background-color var(--theme-color, $color-primary) display block margin-bottom 4px diff --git a/src/themes/buble.styl b/src/themes/buble.styl index 1f633c2df..1602512bf 100644 --- a/src/themes/buble.styl +++ b/src/themes/buble.styl @@ -40,6 +40,7 @@ $sidebar-width = 16rem font-weight 600 .markdown-section a + color $color-primary color var(--theme-color, $color-primary) .markdown-section p, .markdown-section ul, .markdown-section ol @@ -83,6 +84,7 @@ $sidebar-width = 16rem margin 0 .markdown-section blockquote + border-left 4px solid $color-primary border-left 4px solid var(--theme-color, $color-primary) color #858585 margin 2em 0 diff --git a/src/themes/dark.styl b/src/themes/dark.styl index c53e8d9f0..ff0bd783d 100644 --- a/src/themes/dark.styl +++ b/src/themes/dark.styl @@ -34,6 +34,7 @@ body padding 0 ul li.active > a + color $color-primary color var(--theme-color, $color-primary) font-weight 600 @@ -43,6 +44,7 @@ body font-weight 600 .markdown-section a + color $color-primary color var(--theme-color, $color-primary) font-weight 600 @@ -79,6 +81,7 @@ body padding-left 1.5rem .markdown-section blockquote + border-left 4px solid $color-primary border-left 4px solid var(--theme-color, $color-primary) color #858585 margin 2em 0 @@ -138,6 +141,7 @@ body color #2973b7 .token.string + color $color-primary color var(--theme-color, $color-primary) .token.selector @@ -150,6 +154,7 @@ body color #22a2c9 .token.attr-value, .token.control, .token.directive, .token.unit + color $color-primary color var(--theme-color, $color-primary) .token.keyword diff --git a/src/themes/dolphin.styl b/src/themes/dolphin.styl index ded9b16c4..aee2122e8 100644 --- a/src/themes/dolphin.styl +++ b/src/themes/dolphin.styl @@ -36,6 +36,7 @@ body ul li.active > a border-right 2px solid + color $color-primary color var(--theme-color, $color-primary) font-weight 600 @@ -52,9 +53,10 @@ body font-weight 600 .markdown-section a + color $color-primary color var(--theme-color, $color-primary) font-weight 600 - + &:hover text-decoration underline @@ -91,6 +93,7 @@ body padding-left 1.5rem .markdown-section blockquote + border-left 4px solid $color-primary border-left 4px solid var(--theme-color, $color-primary) color #858585 margin 2em 0 @@ -150,6 +153,7 @@ body color #2973b7 .token.string + color $color-primary color var(--theme-color, $color-primary) .token.selector @@ -162,6 +166,7 @@ body color #22a2c9 .token.attr-value, .token.control, .token.directive, .token.unit + color $color-primary color var(--theme-color, $color-primary) .token.keyword, .token.function diff --git a/src/themes/vue.styl b/src/themes/vue.styl index 35fdaf4ce..7eb7ed82f 100644 --- a/src/themes/vue.styl +++ b/src/themes/vue.styl @@ -36,6 +36,7 @@ body ul li.active > a border-right 2px solid + color $color-primary color var(--theme-color, $color-primary) font-weight 600 @@ -52,6 +53,7 @@ body font-weight 600 .markdown-section a + color $color-primary color var(--theme-color, $color-primary) font-weight 600 @@ -88,6 +90,7 @@ body padding-left 1.5rem .markdown-section blockquote + border-left 4px solid $color-primary border-left 4px solid var(--theme-color, $color-primary) color #858585 margin 2em 0 @@ -204,6 +207,7 @@ body color #2973b7 .token.string + color $color-primary color var(--theme-color, $color-primary) .token.selector @@ -216,6 +220,7 @@ body color #22a2c9 .token.attr-value, .token.control, .token.directive, .token.unit + color $color-primary color var(--theme-color, $color-primary) .token.keyword, .token.function From b6ed96edaa9d43b93754f90e1f20ea821cc3110c Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Wed, 2 Feb 2022 23:41:27 -0600 Subject: [PATCH 08/14] Fix gitignore paths --- .gitignore | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 00cdf4834..ba0c48710 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,11 @@ .DS_Store .idea *.log -_playwright-report -_playwright-results -lib -node_modules -themes +/_playwright-report +/_playwright-results +/lib +/node_modules +/themes # exceptions !.gitkeep From 5ad2e74e8364ad39fca1ccb2ccc9576c694228bf Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Wed, 2 Feb 2022 23:41:49 -0600 Subject: [PATCH 09/14] Fix BrowserSync IE error --- test/config/server.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/config/server.js b/test/config/server.js index d7a9cb089..e1181dbcc 100644 --- a/test/config/server.js +++ b/test/config/server.js @@ -44,18 +44,26 @@ function startServer(options = {}, cb = Function.prototype) { match: /<\/body>/i, fn: function (snippet, match) { // Override changelog alias to load local changelog (see routes) - const injectJS = ` + const newSnippet = ` + ${snippet.replace(/]*/, '$& type="text/plain"')} + ${match} `; - return injectJS + snippet + match; + return newSnippet; }, }, }, From 6c08a01b0b2a6975c46c7668516444d90118255d Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Thu, 3 Feb 2022 10:58:42 -0600 Subject: [PATCH 10/14] Fix search field presentation in IE11 - Removed fixed height and allow element to size naturally via font-size and padding - Remove default "x" rendered on IE input fields --- src/plugins/search/component.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/search/component.js b/src/plugins/search/component.js index 06a698e17..946cc015e 100644 --- a/src/plugins/search/component.js +++ b/src/plugins/search/component.js @@ -33,9 +33,8 @@ function style() { outline: none; border: none; width: 100%; - padding: 0 7px; - line-height: 36px; - font-size: 14px; + padding: 0.6em 7px; + font-size: inherit; border: 1px solid transparent; } @@ -51,6 +50,13 @@ function style() { -moz-appearance: none; appearance: none; } + +.search input::-ms-clear { + display: none; + height: 0; + width: 0; +} + .search .clear-button { cursor: pointer; width: 36px; From ae2b9583886554dbb23ead48aab0735b2291ed8a Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Thu, 3 Feb 2022 16:53:42 -0600 Subject: [PATCH 11/14] Revert "Update lifecycle.js" This reverts commit 2a58be69eb75a87b74d0408765e1d222282ac95b. --- src/core/init/lifecycle.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/init/lifecycle.js b/src/core/init/lifecycle.js index 895216c23..22906494a 100644 --- a/src/core/init/lifecycle.js +++ b/src/core/init/lifecycle.js @@ -42,12 +42,11 @@ export function Lifecycle(Base) { try { hookFn(data, result => { data = result; + step(index + 1); }); } catch (err) { console.error(errTitle, err); } - - step(index + 1); } else { try { const result = hookFn(data); From 29128540e82058354987dea4b8f07e9cf542b8e5 Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Thu, 3 Feb 2022 16:53:51 -0600 Subject: [PATCH 12/14] Revert "Update lifecycle.js" This reverts commit 67c5410b049237887811350f38e3f9bc8a2c78dc. --- src/core/init/lifecycle.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core/init/lifecycle.js b/src/core/init/lifecycle.js index 22906494a..cb2d967b4 100644 --- a/src/core/init/lifecycle.js +++ b/src/core/init/lifecycle.js @@ -36,26 +36,29 @@ export function Lifecycle(Base) { if (index >= queue.length) { next(data); } else if (typeof hookFn === 'function') { - const errTitle = `Docsify plugin error (${hookName})`; + const errTitle = `Docsify plugin ${ + hookFn.name ? '"' + hookFn.name + '"' : '' + } error (${hookName})`; if (hookFn.length === 2) { try { hookFn(data, result => { data = result; - step(index + 1); }); } catch (err) { console.error(errTitle, err); } + step(index + 1); } else { - try { - const result = hookFn(data); + let result; - data = result === undefined ? data : data; + try { + result = hookFn(data); } catch (err) { console.error(errTitle, err); } + data = result || data; step(index + 1); } } else { From 88f6ac7edfdf2d85972dbfdd84f07b2b12214727 Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Thu, 3 Feb 2022 16:53:56 -0600 Subject: [PATCH 13/14] Revert "Add try/catch w/ error message to plugin calls" This reverts commit 631e9248786f87a5b2f7892fc73a53543744d288. --- src/core/init/lifecycle.js | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/core/init/lifecycle.js b/src/core/init/lifecycle.js index cb2d967b4..c04fc1a72 100644 --- a/src/core/init/lifecycle.js +++ b/src/core/init/lifecycle.js @@ -36,29 +36,14 @@ export function Lifecycle(Base) { if (index >= queue.length) { next(data); } else if (typeof hookFn === 'function') { - const errTitle = `Docsify plugin ${ - hookFn.name ? '"' + hookFn.name + '"' : '' - } error (${hookName})`; - if (hookFn.length === 2) { - try { - hookFn(data, result => { - data = result; - }); - } catch (err) { - console.error(errTitle, err); - } - step(index + 1); + hookFn(data, result => { + data = result; + step(index + 1); + }); } else { - let result; - - try { - result = hookFn(data); - } catch (err) { - console.error(errTitle, err); - } - - data = result || data; + const result = hookFn(data); + data = result === undefined ? data : result; step(index + 1); } } else { From 72da42e5bccac6c6f09663f573e7f419528a03aa Mon Sep 17 00:00:00 2001 From: John Hildenbiddle Date: Sat, 5 Feb 2022 03:09:38 -0600 Subject: [PATCH 14/14] Fix docsify-plugin-carbon error & ESLint errors --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 206c1fe3d..388969e8c 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@
- +