From 756c79ff8a4b28142d7c30a2740c7157e62ac6d4 Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Mon, 8 Mar 2021 22:37:15 -0800 Subject: [PATCH 01/60] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 72 ++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2d5b3e545..4c0bc8468 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,47 +1,65 @@ - - + - - +## **Summary** -**Summary** + -**What kind of change does this PR introduce?** (check at least one) + -- [ ] Bugfix -- [ ] Feature -- [ ] Code style update -- [ ] Refactor -- [ ] Docs -- [ ] Build-related changes -- [ ] Repo settings -- [ ] Other, please describe: +## **What kind of change does this PR introduce?** -If changing the UI of default theme, please provide the **before/after** screenshot: + -**Does this PR introduce a breaking change?** (check one) + + + + +## **For any code change,** + +- [ ] Related documentation has been updated if needed +- [ ] Related tests have been updated or tests have been added + +## **Does this PR introduce a breaking change?** (check one) - [ ] Yes - [ ] No If yes, please describe the impact and migration path for existing applications: -**The PR fulfills these requirements:** +## **Related issue, if any:** -- [ ] When resolving a specific issue, it's referenced in the PR's title (e.g. `fix #xxx[,#xxx]`, where "xxx" is the issue number) + -You have tested in the following browsers: (Providing a detailed version will be better.) +## **Tested in the following browsers:** - [ ] Chrome - [ ] Firefox - [ ] Safari - [ ] Edge - [ ] IE - -If adding a **new feature**, the PR's description includes: - -- [ ] A convincing reason for adding this feature -- [ ] Related documents have been updated -- [ ] Related tests have been updated - -To avoid wasting your time, it's best to open a **feature request issue** first and wait for approval before working on it. From b8653e1f32557966af95b6f77a70d2ef1904081b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Thu, 11 Mar 2021 16:13:08 +0800 Subject: [PATCH 02/60] chore: fix microsoft/playwright-github-action error (#1534) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 296b8d7ed..e454085e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: run: npm run test:unit -- -ci --runInBand - name: integration tests run: npm run test:integration -- -ci --runInBand - - uses: microsoft/playwright-github-action@v1.3.0 + - uses: microsoft/playwright-github-action@v1 - name: e2e tests run: npm run test:e2e -- --ci --runInBand - name: Upload artifacts (diff output) From d6df2b85a99371bb9a87402a10dd515bb734182e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Fri, 12 Mar 2021 08:48:28 +0800 Subject: [PATCH 03/60] fix: Cannot read property 'classList' of null (#1527) * fix: Cannot read property 'classList' of null * fix: Cannot read property classList of null https://github.com/docsifyjs/docsify/pull/1527#issuecomment-793455105 --- src/plugins/search/component.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/search/component.js b/src/plugins/search/component.js index 388de395d..06a698e17 100644 --- a/src/plugins/search/component.js +++ b/src/plugins/search/component.js @@ -137,8 +137,8 @@ function doSearch(value) { $panel.innerHTML = ''; if (options.hideOtherSidebarContent) { - $sidebarNav.classList.remove('hide'); - $appName.classList.remove('hide'); + $sidebarNav && $sidebarNav.classList.remove('hide'); + $appName && $appName.classList.remove('hide'); } return; @@ -160,8 +160,8 @@ function doSearch(value) { $clearBtn.classList.add('show'); $panel.innerHTML = html || `

${NO_DATA_TEXT}

`; if (options.hideOtherSidebarContent) { - $sidebarNav.classList.add('hide'); - $appName.classList.add('hide'); + $sidebarNav && $sidebarNav.classList.add('hide'); + $appName && $appName.classList.add('hide'); } } From f19dc69aaf0df68f41cdf4b0044224e9f4d4a836 Mon Sep 17 00:00:00 2001 From: Mitchell Wright Date: Wed, 17 Mar 2021 11:21:33 -0500 Subject: [PATCH 04/60] docs:Update deploy, change Zeit to Vercel (#1540) --- docs/deploy.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/deploy.md b/docs/deploy.md index 2c96060f9..aac87df21 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -88,11 +88,11 @@ When using the HTML5 router, you need to set up redirect rules that redirect all /* /index.html 200 ``` -## ZEIT Now +## Vercel -1. Install [Now CLI](https://zeit.co/download), `npm i -g now` +1. Install [Vercel CLI](https://vercel.com/download), `npm i -g vercel` 2. Change directory to your docsify website, for example `cd docs` -3. Deploy with a single command, `now` +3. Deploy with a single command, `vercel` ## AWS Amplify From d607f6d71c35b50f586806a832f65061f5e3427e Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Tue, 23 Mar 2021 05:49:01 +0200 Subject: [PATCH 05/60] fix: Upgrade docsify from 4.12.0 to 4.12.1 (#1544) The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-DOCSIFY-1066017 --- packages/docsify-server-renderer/package-lock.json | 12 ++++++------ packages/docsify-server-renderer/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index ba64d4356..2dcf4069e 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "clipboard": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz", - "integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.8.tgz", + "integrity": "sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ==", "optional": true, "requires": { "good-listener": "^1.2.2", @@ -30,9 +30,9 @@ "optional": true }, "docsify": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/docsify/-/docsify-4.12.0.tgz", - "integrity": "sha512-oLr48dLeJ8sTVQfL8HLFqd2sPPG8DNAOvYAXXJQr/+/K9uC2KDhoeu+GGj5U2uFGR5czF3oLvqNBxhEElg1wGw==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/docsify/-/docsify-4.12.1.tgz", + "integrity": "sha512-7v4UlCYLTmb83leJLIlheQlQ8kDTbTxcpMttRg0Uf92Nl//m0AcKFHoLLo5HHS4UhnO0KhDV8SKCdTR279zI9A==", "requires": { "dompurify": "^2.2.6", "marked": "^1.2.9", diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index a254f2cef..2aa3226ae 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -16,7 +16,7 @@ }, "dependencies": { "debug": "^4.3.2", - "docsify": "^4.12.0", + "docsify": "^4.12.1", "dompurify": "^2.2.6", "node-fetch": "^2.6.0", "resolve-pathname": "^3.0.0" From c2cf163fc0a02378f27792ce58ac6e5fc5a8bf65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Sun, 28 Mar 2021 18:46:09 +0800 Subject: [PATCH 06/60] chore: Fix search for missing pathNamespaces (#1547) --- docs/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.html b/docs/index.html index 27dadcaaa..20ef2ede7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -111,6 +111,7 @@ '/zh-cn/': '搜索', '/': 'Search', }, + pathNamespaces: ['/es', '/de-de', '/ru-ru', '/zh-cn'] }, vueComponents: { 'button-counter': { From 6ee77d237faac0f12ab68afbf9d76995f2cf628a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Mar 2021 10:36:21 +0800 Subject: [PATCH 07/60] chore: bump y18n from 4.0.0 to 4.0.1 (#1548) Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 82 +++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a7c5a23f..ee479b052 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4347,14 +4347,14 @@ } }, "@vue/compiler-core": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.7.tgz", - "integrity": "sha512-JFohgBXoyUc3mdeI2WxlhjQZ5fakfemJkZHX8Gu/nFbEg3+lKVUZmNKWmmnp9aOzJQZKoj77LjmFxiP+P+7lMQ==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.9.tgz", + "integrity": "sha512-bHAPwfVoLhGx8d6KV/OfGf/3gwpymVirgfmSyhgv5YuXDybLa6BwjSLvhNMAyDP+4q4pp0p6g248LuoOy5W6OA==", "dev": true, "requires": { "@babel/parser": "^7.12.0", "@babel/types": "^7.12.0", - "@vue/shared": "3.0.7", + "@vue/shared": "3.0.9", "estree-walker": "^2.0.1", "source-map": "^0.6.1" }, @@ -4366,15 +4366,15 @@ "dev": true }, "@babel/parser": { - "version": "7.13.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.9.tgz", - "integrity": "sha512-nEUfRiARCcaVo3ny3ZQjURjHQZUo/JkEw7rLlSZy/psWGnvwXFtPcr6jb7Yb41DVW5LTe6KRq9LGleRNsg1Frw==", + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.13.tgz", + "integrity": "sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw==", "dev": true }, "@babel/types": { - "version": "7.13.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.0.tgz", - "integrity": "sha512-hE+HE8rnG1Z6Wzo+MhaKE5lM5eMx71T4EHJgku2E3xIfaULhDcxiiRxUYgwX8qwP1BBSlag+TdGOt6JAidIZTA==", + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz", + "integrity": "sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.12.11", @@ -4397,49 +4397,49 @@ } }, "@vue/compiler-dom": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.0.7.tgz", - "integrity": "sha512-VnIH9EbWQm/Tkcp+8dCaNVsVvhm/vxCrIKWRkXY9215hTqOqQOvejT8IMjd2kc++nIsYMsdQk6H9qqBvoLe/Cw==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.0.9.tgz", + "integrity": "sha512-tkq6umPSELaghvOExWfGNwrCRc7FTul3RLykKzBZWhb87sSESq0XxiKELfBOfEbzdhWg6BJ1WXKDeq+al/viEQ==", "dev": true, "requires": { - "@vue/compiler-core": "3.0.7", - "@vue/shared": "3.0.7" + "@vue/compiler-core": "3.0.9", + "@vue/shared": "3.0.9" } }, "@vue/reactivity": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.7.tgz", - "integrity": "sha512-FotWcNNaKhqpFZrdgsUOZ1enlJ5lhTt01CNTtLSyK7jYFgZBTuw8vKsEutZKDYZ1XKotOfoeO8N3pZQqmM6Etw==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.9.tgz", + "integrity": "sha512-W1AbGhzphVjY+TL32lQDwLDNvLzZKOcUgaIaLOoALWMtjzN4ExOUJzrR1FC3ynlpMHIEfcUo8GPgfnNmvMGdgQ==", "dev": true, "requires": { - "@vue/shared": "3.0.7" + "@vue/shared": "3.0.9" } }, "@vue/runtime-core": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.0.7.tgz", - "integrity": "sha512-DBAZAwVvdmMXuyd6/9qqj/kYr/GaLTmn1L2/QLxLwP+UfhIboiTSBc/tUUb8MRk7Bb98GzNeAWkkT6AfooS3dQ==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.0.9.tgz", + "integrity": "sha512-j94xZ/wRZTVhqpoUgmxBTlojnPFu6TTXNw1Vw8oQkW1ZTGD0IwiJe3ycsKd1bpleXEMVt55GzGlCopI33/Gdmg==", "dev": true, "requires": { - "@vue/reactivity": "3.0.7", - "@vue/shared": "3.0.7" + "@vue/reactivity": "3.0.9", + "@vue/shared": "3.0.9" } }, "@vue/runtime-dom": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.0.7.tgz", - "integrity": "sha512-Oij4ruOtnpQpCj+/Q3JPzgpTJ1Q7+N67pA53A8KVITEtxfvKL46NN6dhAZ5NGqwX6RWZpYqWQNewITeF0pHr8g==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.0.9.tgz", + "integrity": "sha512-6NCjpwa5hNBFDdokquAgMl2tNEYyQD6kBy9Mh6M2776bxYLXZCqL4/e0UrpBuBiHTrkAlUGODD7PyYGaqH6fyA==", "dev": true, "requires": { - "@vue/runtime-core": "3.0.7", - "@vue/shared": "3.0.7", + "@vue/runtime-core": "3.0.9", + "@vue/shared": "3.0.9", "csstype": "^2.6.8" } }, "@vue/shared": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.0.7.tgz", - "integrity": "sha512-dn5FyfSc4ky424jH4FntiHno7Ss5yLkqKNmM/NXwANRnlkmqu74pnGetexDFVG5phMk9/FhwovUZCWGxsotVKg==", + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.0.9.tgz", + "integrity": "sha512-lv20q1O5dybwro+V+vnxHCmSIxi9mvTORSgAbGrANGYK8zF4K1S9TOankIvdkcvfZ88IR95O2pTI2Pb3c3BaNg==", "dev": true }, "@zkochan/cmd-shim": { @@ -20241,14 +20241,14 @@ "dev": true }, "vue3": { - "version": "npm:vue@3.0.7", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.0.7.tgz", - "integrity": "sha512-8h4TikD+JabbMK9aRlBO4laG0AtNHRPHynxYgWZ9sq1YUPfzynd9Jeeb27XNyZytC7aCQRX9xe1+TQJuc181Tw==", + "version": "npm:vue@3.0.9", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.0.9.tgz", + "integrity": "sha512-MOvqDpvDslMWJo5kyGW1nTsTIPAuSzgVqmlzSQInIEqkHOu16pNbXuTjnG7jc/yIvQYFSQZqv6Pvad0iO5QkyQ==", "dev": true, "requires": { - "@vue/compiler-dom": "3.0.7", - "@vue/runtime-dom": "3.0.7", - "@vue/shared": "3.0.7" + "@vue/compiler-dom": "3.0.9", + "@vue/runtime-dom": "3.0.9", + "@vue/shared": "3.0.9" } }, "w3c-hr-time": { @@ -20678,9 +20678,9 @@ "dev": true }, "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", "dev": true }, "yallist": { From 407e4d4f3de78bebd639a3fdae751f8045728e57 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Wed, 7 Apr 2021 18:16:25 +0300 Subject: [PATCH 08/60] fix: upgrade dompurify from 2.2.6 to 2.2.7 (#1552) Snyk has created this PR to upgrade dompurify from 2.2.6 to 2.2.7. See this package in npm: https://www.npmjs.com/package/dompurify See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/6efe7e04-4e52-497e-8ad5-570733cc577a?utm_source=github&utm_medium=upgrade-pr --- packages/docsify-server-renderer/package-lock.json | 6 +++--- packages/docsify-server-renderer/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index 2dcf4069e..ee64de857 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -45,9 +45,9 @@ } }, "dompurify": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.6.tgz", - "integrity": "sha512-7b7ZArhhH0SP6W2R9cqK6RjaU82FZ2UPM7RO8qN1b1wyvC/NY1FNWcX1Pu00fFOAnzEORtwXe4bPaClg6pUybQ==" + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.7.tgz", + "integrity": "sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg==" }, "good-listener": { "version": "1.2.2", diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index 2aa3226ae..82197b8eb 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -17,7 +17,7 @@ "dependencies": { "debug": "^4.3.2", "docsify": "^4.12.1", - "dompurify": "^2.2.6", + "dompurify": "^2.2.7", "node-fetch": "^2.6.0", "resolve-pathname": "^3.0.0" } From 93c48f3d615d95dba550a0e95df6b545d68c3593 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Sat, 10 Apr 2021 08:32:30 +0300 Subject: [PATCH 09/60] fix: Upgrade dompurify from 2.2.6 to 2.2.7 (#1553) * fix: upgrade dompurify from 2.2.6 to 2.2.7 Snyk has created this PR to upgrade dompurify from 2.2.6 to 2.2.7. See this package in npm: https://www.npmjs.com/package/dompurify See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr * fix: missing vue Co-authored-by: sy-records <52o@qq52o.cn> --- package-lock.json | 70 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee479b052..973f404b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4347,14 +4347,14 @@ } }, "@vue/compiler-core": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.9.tgz", - "integrity": "sha512-bHAPwfVoLhGx8d6KV/OfGf/3gwpymVirgfmSyhgv5YuXDybLa6BwjSLvhNMAyDP+4q4pp0p6g248LuoOy5W6OA==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.11.tgz", + "integrity": "sha512-6sFj6TBac1y2cWCvYCA8YzHJEbsVkX7zdRs/3yK/n1ilvRqcn983XvpBbnN3v4mZ1UiQycTvOiajJmOgN9EVgw==", "dev": true, "requires": { "@babel/parser": "^7.12.0", "@babel/types": "^7.12.0", - "@vue/shared": "3.0.9", + "@vue/shared": "3.0.11", "estree-walker": "^2.0.1", "source-map": "^0.6.1" }, @@ -4397,49 +4397,49 @@ } }, "@vue/compiler-dom": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.0.9.tgz", - "integrity": "sha512-tkq6umPSELaghvOExWfGNwrCRc7FTul3RLykKzBZWhb87sSESq0XxiKELfBOfEbzdhWg6BJ1WXKDeq+al/viEQ==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.0.11.tgz", + "integrity": "sha512-+3xB50uGeY5Fv9eMKVJs2WSRULfgwaTJsy23OIltKgMrynnIj8hTYY2UL97HCoz78aDw1VDXdrBQ4qepWjnQcw==", "dev": true, "requires": { - "@vue/compiler-core": "3.0.9", - "@vue/shared": "3.0.9" + "@vue/compiler-core": "3.0.11", + "@vue/shared": "3.0.11" } }, "@vue/reactivity": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.9.tgz", - "integrity": "sha512-W1AbGhzphVjY+TL32lQDwLDNvLzZKOcUgaIaLOoALWMtjzN4ExOUJzrR1FC3ynlpMHIEfcUo8GPgfnNmvMGdgQ==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.11.tgz", + "integrity": "sha512-SKM3YKxtXHBPMf7yufXeBhCZ4XZDKP9/iXeQSC8bBO3ivBuzAi4aZi0bNoeE2IF2iGfP/AHEt1OU4ARj4ao/Xw==", "dev": true, "requires": { - "@vue/shared": "3.0.9" + "@vue/shared": "3.0.11" } }, "@vue/runtime-core": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.0.9.tgz", - "integrity": "sha512-j94xZ/wRZTVhqpoUgmxBTlojnPFu6TTXNw1Vw8oQkW1ZTGD0IwiJe3ycsKd1bpleXEMVt55GzGlCopI33/Gdmg==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.0.11.tgz", + "integrity": "sha512-87XPNwHfz9JkmOlayBeCCfMh9PT2NBnv795DSbi//C/RaAnc/bGZgECjmkD7oXJ526BZbgk9QZBPdFT8KMxkAg==", "dev": true, "requires": { - "@vue/reactivity": "3.0.9", - "@vue/shared": "3.0.9" + "@vue/reactivity": "3.0.11", + "@vue/shared": "3.0.11" } }, "@vue/runtime-dom": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.0.9.tgz", - "integrity": "sha512-6NCjpwa5hNBFDdokquAgMl2tNEYyQD6kBy9Mh6M2776bxYLXZCqL4/e0UrpBuBiHTrkAlUGODD7PyYGaqH6fyA==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.0.11.tgz", + "integrity": "sha512-jm3FVQESY3y2hKZ2wlkcmFDDyqaPyU3p1IdAX92zTNeCH7I8zZ37PtlE1b9NlCtzV53WjB4TZAYh9yDCMIEumA==", "dev": true, "requires": { - "@vue/runtime-core": "3.0.9", - "@vue/shared": "3.0.9", + "@vue/runtime-core": "3.0.11", + "@vue/shared": "3.0.11", "csstype": "^2.6.8" } }, "@vue/shared": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.0.9.tgz", - "integrity": "sha512-lv20q1O5dybwro+V+vnxHCmSIxi9mvTORSgAbGrANGYK8zF4K1S9TOankIvdkcvfZ88IR95O2pTI2Pb3c3BaNg==", + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.0.11.tgz", + "integrity": "sha512-b+zB8A2so8eCE0JsxjL24J7vdGl8rzPQ09hZNhystm+KqSbKcAej1A+Hbva1rCMmTTqA+hFnUSDc5kouEo0JzA==", "dev": true }, "@zkochan/cmd-shim": { @@ -7233,9 +7233,9 @@ } }, "dompurify": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.6.tgz", - "integrity": "sha512-7b7ZArhhH0SP6W2R9cqK6RjaU82FZ2UPM7RO8qN1b1wyvC/NY1FNWcX1Pu00fFOAnzEORtwXe4bPaClg6pUybQ==" + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.7.tgz", + "integrity": "sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg==" }, "domutils": { "version": "1.7.0", @@ -20241,14 +20241,14 @@ "dev": true }, "vue3": { - "version": "npm:vue@3.0.9", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.0.9.tgz", - "integrity": "sha512-MOvqDpvDslMWJo5kyGW1nTsTIPAuSzgVqmlzSQInIEqkHOu16pNbXuTjnG7jc/yIvQYFSQZqv6Pvad0iO5QkyQ==", + "version": "npm:vue@3.0.11", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.0.11.tgz", + "integrity": "sha512-3/eUi4InQz8MPzruHYSTQPxtM3LdZ1/S/BvaU021zBnZi0laRUyH6pfuE4wtUeLvI8wmUNwj5wrZFvbHUXL9dw==", "dev": true, "requires": { - "@vue/compiler-dom": "3.0.9", - "@vue/runtime-dom": "3.0.9", - "@vue/shared": "3.0.9" + "@vue/compiler-dom": "3.0.11", + "@vue/runtime-dom": "3.0.11", + "@vue/shared": "3.0.11" } }, "w3c-hr-time": { diff --git a/package.json b/package.json index 80c1b4974..39e4cc48c 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "*.js": "eslint --fix" }, "dependencies": { - "dompurify": "^2.2.6", + "dompurify": "^2.2.7", "marked": "^1.2.9", "medium-zoom": "^1.0.6", "opencollective-postinstall": "^2.0.2", From 32203b77bf5d64afcdffcb0fd21b2b9035e64e25 Mon Sep 17 00:00:00 2001 From: wxq Date: Sun, 11 Apr 2021 21:02:11 +0800 Subject: [PATCH 10/60] docs: link with plugin Pagination (#1554) Co-authored-by: Koy --- docs/plugins.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/plugins.md b/docs/plugins.md index cd7016d6b..c5d0cc7fe 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -187,6 +187,8 @@ Pagination for docsify. By [@imyelo](https://github.com/imyelo) ``` +Click [here](https://github.com/imyelo/docsify-pagination#readme) to get more information. + ## Tabs A docsify.js plugin for displaying tabbed content from markdown. From c24f7f6f0b87a87f6dd3755f69eb0969ebb029c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Mon, 12 Apr 2021 09:47:39 +0800 Subject: [PATCH 11/60] fix: Add escapeHtml for search (#1551) Co-authored-by: Anix --- src/plugins/search/search.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/search/search.js b/src/plugins/search/search.js index 94047c2ee..ce7481c5e 100644 --- a/src/plugins/search/search.js +++ b/src/plugins/search/search.js @@ -178,7 +178,7 @@ export function search(query) { keywords.forEach(keyword => { // From https://github.com/sindresorhus/escape-string-regexp const regEx = new RegExp( - ignoreDiacriticalMarks(keyword).replace( + escapeHtml(ignoreDiacriticalMarks(keyword)).replace( /[|\\{}()[\]^$+*?.]/g, '\\$&' ), @@ -187,10 +187,10 @@ export function search(query) { let indexTitle = -1; let indexContent = -1; handlePostTitle = postTitle - ? ignoreDiacriticalMarks(postTitle) + ? escapeHtml(ignoreDiacriticalMarks(postTitle)) : postTitle; handlePostContent = postContent - ? ignoreDiacriticalMarks(postContent) + ? escapeHtml(ignoreDiacriticalMarks(postContent)) : postContent; indexTitle = postTitle ? handlePostTitle.search(regEx) : -1; From a6fbe079d3d8a1cb83fd6c25499841cefe097c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Sun, 18 Apr 2021 16:14:33 +0800 Subject: [PATCH 12/60] chore: Update Edit Document using develop branch (#1541) --- docs/index.html | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index 20ef2ede7..7fbd75241 100644 --- a/docs/index.html +++ b/docs/index.html @@ -180,7 +180,7 @@ .replace('@master', '/blob/master'); } else { url = - 'https://github.com/docsifyjs/docsify/blob/master/docs/' + + 'https://github.com/docsifyjs/docsify/blob/develop/docs/' + vm.route.file; } var editHtml = '[:memo: Edit Document](' + url + ')\n'; diff --git a/index.html b/index.html index eb130236c..40758b605 100644 --- a/index.html +++ b/index.html @@ -91,7 +91,7 @@ .replace('@master', '/blob/master'); } else { url = - 'https://github.com/docsifyjs/docsify/blob/master/docs/' + + 'https://github.com/docsifyjs/docsify/blob/develop/docs/' + vm.route.file; } var editHtml = '[:memo: Edit Document](' + url + ')\n'; From 86f134d13254286efa6f4dfe7a8969c0b50b8bb2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 May 2021 08:15:40 +0800 Subject: [PATCH 13/60] chore: bump ssri from 6.0.1 to 6.0.2 (#1563) Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/npm/ssri/releases) - [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md) - [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 973f404b7..d0e18ec86 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4360,25 +4360,24 @@ }, "dependencies": { "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", "dev": true }, "@babel/parser": { - "version": "7.13.13", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.13.tgz", - "integrity": "sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.0.tgz", + "integrity": "sha512-AHbfoxesfBALg33idaTBVUkLnfXtsgvJREf93p4p0Lwsz4ppfE7g1tpEXVm4vrxUcH4DVhAa9Z1m1zqf9WUC7Q==", "dev": true }, "@babel/types": { - "version": "7.13.14", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz", - "integrity": "sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==", + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.0.tgz", + "integrity": "sha512-O2LVLdcnWplaGxiPBz12d0HcdN8QdxdsWYhz5LSeuukV/5mn2xUUc3gBeU4QBYPJ18g/UToe8F532XJ608prmg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.12.11", - "lodash": "^4.17.19", + "@babel/helper-validator-identifier": "^7.14.0", "to-fast-properties": "^2.0.0" } }, @@ -6879,9 +6878,9 @@ } }, "csstype": { - "version": "2.6.16", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.16.tgz", - "integrity": "sha512-61FBWoDHp/gRtsoDkq/B1nWrCUG/ok1E3tUrcNbZjsE9Cxd9yzUirjS3+nAATB8U4cTtaQmAHbNndoFz5L6C9Q==", + "version": "2.6.17", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.17.tgz", + "integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==", "dev": true }, "currently-unhandled": { @@ -18965,9 +18964,9 @@ "dev": true }, "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", + "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", "dev": true, "requires": { "figgy-pudding": "^3.5.1" From e3e3c760b83eb72b4057966c809cda049e4c629f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 May 2021 09:29:25 +0800 Subject: [PATCH 14/60] chore: bump handlebars from 4.7.6 to 4.7.7 (#1566) Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7. - [Release notes](https://github.com/wycats/handlebars.js/releases) - [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md) - [Commits](https://github.com/wycats/handlebars.js/compare/v4.7.6...v4.7.7) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index d0e18ec86..35458b416 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4366,15 +4366,15 @@ "dev": true }, "@babel/parser": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.0.tgz", - "integrity": "sha512-AHbfoxesfBALg33idaTBVUkLnfXtsgvJREf93p4p0Lwsz4ppfE7g1tpEXVm4vrxUcH4DVhAa9Z1m1zqf9WUC7Q==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", "dev": true }, "@babel/types": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.0.tgz", - "integrity": "sha512-O2LVLdcnWplaGxiPBz12d0HcdN8QdxdsWYhz5LSeuukV/5mn2xUUc3gBeU4QBYPJ18g/UToe8F532XJ608prmg==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", + "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.14.0", @@ -9506,9 +9506,9 @@ "optional": true }, "handlebars": { - "version": "4.7.6", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", - "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", "dev": true, "requires": { "minimist": "^1.2.5", From 108d3ed682330b8414db06216c7244ef122ac86b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 May 2021 13:11:14 +0800 Subject: [PATCH 15/60] chore: bump lodash from 4.17.20 to 4.17.21 (#1567) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 35458b416..95ed1cd6e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14154,9 +14154,9 @@ } }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, "lodash._reinterpolate": { From 37d9f0e1214276e93b2a11ed87390aafa1bdbcec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Sun, 9 May 2021 08:28:55 +0800 Subject: [PATCH 16/60] fix: buble theme missing generic fallback font (#1568) --- src/themes/buble.styl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/themes/buble.styl b/src/themes/buble.styl index 83714c178..1f633c2df 100644 --- a/src/themes/buble.styl +++ b/src/themes/buble.styl @@ -101,14 +101,14 @@ $sidebar-width = 16rem .markdown-section code background-color #f9f9f9 border-radius 3px - font-family Inconsolata + font-family Inconsolata, monospace padding 0.2em 0.4rem white-space nowrap .markdown-section pre background-color #f9f9f9 border-left 2px solid #eee - font-family Inconsolata + font-family Inconsolata, monospace font-size 16px margin 0 0 1em 0 padding 8px @@ -159,7 +159,7 @@ $sidebar-width = 16rem background-color #f8f8f8 border-radius 2px display block - font-family Inconsolata + font-family Inconsolata, monospace line-height 1.1rem max-width inherit overflow inherit From 043c9c9f334bedfba58bdac9588a57f965e9eb49 Mon Sep 17 00:00:00 2001 From: Koy Date: Sun, 9 May 2021 09:14:32 +0800 Subject: [PATCH 17/60] docs: add note on video/media attrs. (#1559) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: add note on video/media attrs. * update: refine decription. Co-authored-by: 沈唁 <52o@qq52o.cn> --- docs/embed-files.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/embed-files.md b/docs/embed-files.md index 26a0072ea..07aa561f7 100644 --- a/docs/embed-files.md +++ b/docs/embed-files.md @@ -73,6 +73,11 @@ Example: If you embed the file as `iframe`, `audio` and `video`, then you may need to set the attributes of these tags. +?> Note, for the `audio` and `video` types, docsify adds the `controls` attribute by default. When you want add more attributes, the `controls` attribute need to be added manually if need be. +```md +[filename](_media/example.mp4 ':include :type=video controls width=100%') +``` + ```markdown [cinwell website](https://cinwell.com ':include :type=iframe width=100% height=400px') ``` From e03b335d379817775fee04c4244b6da5f0695a0a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 May 2021 10:03:31 +0800 Subject: [PATCH 18/60] chore: bump hosted-git-info from 2.8.8 to 2.8.9 (#1570) Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9. - [Release notes](https://github.com/npm/hosted-git-info/releases) - [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md) - [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 95ed1cd6e..8295a5843 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9699,9 +9699,9 @@ } }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "hsl-regex": { From e6d72a29666d29c1574326cc0a0fa98b768432b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 May 2021 09:05:00 +0800 Subject: [PATCH 19/60] chore: bump browserslist from 4.14.5 to 4.16.6 (#1578) Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.14.5 to 4.16.6. - [Release notes](https://github.com/browserslist/browserslist/releases) - [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md) - [Commits](https://github.com/browserslist/browserslist/compare/4.14.5...4.16.6) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 77 ++++++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8295a5843..0201311a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4366,15 +4366,15 @@ "dev": true }, "@babel/parser": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz", - "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q==", + "version": "7.14.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.3.tgz", + "integrity": "sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ==", "dev": true }, "@babel/types": { - "version": "7.14.1", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz", - "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==", + "version": "7.14.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz", + "integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.14.0", @@ -5386,15 +5386,42 @@ } }, "browserslist": { - "version": "4.14.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.5.tgz", - "integrity": "sha512-Z+vsCZIvCBvqLoYkBFTwEYH3v5MCQbsAjp50ERycpOjnPmolg1Gjy4+KaWWpm8QOJt9GHkhdqAl14NpCX73CWA==", + "version": "4.16.6", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", + "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001135", - "electron-to-chromium": "^1.3.571", - "escalade": "^3.1.0", - "node-releases": "^1.1.61" + "caniuse-lite": "^1.0.30001219", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.723", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + }, + "dependencies": { + "caniuse-lite": { + "version": "1.0.30001228", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz", + "integrity": "sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.736", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.736.tgz", + "integrity": "sha512-DY8dA7gR51MSo66DqitEQoUMQ0Z+A2DSXFi7tK304bdTVqczCAfUuyQw6Wdg8hIoo5zIxkU1L24RQtUce1Ioig==", + "dev": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, + "node-releases": { + "version": "1.1.72", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.72.tgz", + "integrity": "sha512-LLUo+PpH3dU6XizX3iVoubUNheF/owjXCZZ5yACDxNnPtgFuludV1ZL3ayK1kVep42Rmm0+R9/Y60NQbZ2bifw==", + "dev": true + } } }, "bs-recipes": { @@ -5971,6 +5998,12 @@ "simple-swizzle": "^0.2.2" } }, + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true + }, "colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -7333,12 +7366,6 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", "dev": true }, - "electron-to-chromium": { - "version": "1.3.576", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.576.tgz", - "integrity": "sha512-uSEI0XZ//5ic+0NdOqlxp0liCD44ck20OAGyLMSymIWTEAtHKVJi6JM18acOnRgUgX7Q65QqnI+sNncNvIy8ew==", - "dev": true - }, "emittery": { "version": "0.7.1", "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.1.tgz", @@ -7590,12 +7617,6 @@ "es6-promise": "^4.0.3" } }, - "escalade": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.0.tgz", - "integrity": "sha512-mAk+hPSO8fLDkhV7V0dXazH5pDc6MrjBTPyD3VeKzxnVFjH1MIxbCdqGZB9O8+EwWakZs3ZCbDS4IpRt79V1ig==", - "dev": true - }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -15199,12 +15220,6 @@ "process-on-spawn": "^1.0.0" } }, - "node-releases": { - "version": "1.1.61", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.61.tgz", - "integrity": "sha512-DD5vebQLg8jLCOzwupn954fbIiZht05DAZs0k2u8NStSe6h9XdsuIQL8hSRKYiU8WUQRznmSDrKGbv3ObOmC7g==", - "dev": true - }, "nopt": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", From 0dd44cc828cc54f7c3b776d45b32925b66cae499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Tue, 25 May 2021 09:18:53 +0800 Subject: [PATCH 20/60] fix: upgrade dompurify from 2.2.7 to 2.2.8 (#1577) --- package-lock.json | 64 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0201311a0..d4e6d46e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1099,9 +1099,9 @@ "integrity": "sha512-k1WGfKRQyhJpIr+P17O5vLIo2ko1PFLKwoetatdduUSt/aQ4J2sJrJwwatdI5Z3SiYk/mRH9S3JpdmMFd/IK4g==", "dev": true, "requires": { - "JSONStream": "^1.3.4", "bluebird": "^3.5.1", "figgy-pudding": "^3.4.1", + "JSONStream": "^1.3.4", "lru-cache": "^5.1.1", "make-fetch-happen": "^5.0.0", "npm-package-arg": "^6.1.0", @@ -4452,16 +4452,6 @@ "mz": "^2.5.0" } }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, "abab": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", @@ -6370,8 +6360,8 @@ "integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==", "dev": true, "requires": { - "JSONStream": "^1.0.4", "is-text-path": "^1.0.1", + "JSONStream": "^1.0.4", "lodash": "^4.17.15", "meow": "^7.0.0", "split2": "^2.0.0", @@ -7265,9 +7255,9 @@ } }, "dompurify": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.7.tgz", - "integrity": "sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg==" + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.8.tgz", + "integrity": "sha512-9H0UL59EkDLgY3dUFjLV6IEUaHm5qp3mxSqWw7Yyx4Zhk2Jn2cmLe+CNPP3xy13zl8Bqg+0NehQzkdMoVhGRww==" }, "domutils": { "version": "1.7.0", @@ -13231,6 +13221,16 @@ "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "dev": true }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -19078,6 +19078,23 @@ "limiter": "^1.0.5" } }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -19232,23 +19249,6 @@ } } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, "stringify-object": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", diff --git a/package.json b/package.json index 39e4cc48c..f48bca253 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "*.js": "eslint --fix" }, "dependencies": { - "dompurify": "^2.2.7", + "dompurify": "^2.2.8", "marked": "^1.2.9", "medium-zoom": "^1.0.6", "opencollective-postinstall": "^2.0.2", From f80846bd4a96ad51a0327ae2cf58bbe0ee6dd00d Mon Sep 17 00:00:00 2001 From: wxq Date: Fri, 4 Jun 2021 12:19:03 +0800 Subject: [PATCH 21/60] docs: src of docsify-copy-code (#1585) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 沈唁 <52o@qq52o.cn> --- docs/plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins.md b/docs/plugins.md index c5d0cc7fe..c128c4f30 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -138,7 +138,7 @@ When readers expand the demo box, the source code and description are shown ther Add a simple `Click to copy` button to all preformatted code blocks to effortlessly allow users to copy example code from your docs. Provided by [@jperasmus](https://github.com/jperasmus) ```html - + ``` See [here](https://github.com/jperasmus/docsify-copy-code/blob/master/README.md) for more details. From ec16e4a9d5718ac4f4c25bb3dcaea3b7551372e0 Mon Sep 17 00:00:00 2001 From: luwol03 Date: Tue, 22 Jun 2021 14:31:45 +0200 Subject: [PATCH 22/60] fix: allow also " inside of an embed --- docs/embed-files.md | 2 +- src/core/render/utils.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/embed-files.md b/docs/embed-files.md index 07aa561f7..480d5fc5f 100644 --- a/docs/embed-files.md +++ b/docs/embed-files.md @@ -16,7 +16,7 @@ Then the content of `example.md` will be displayed directly here; You can check the original content for [example.md](_media/example.md ':ignore'). -Normally, this will compiled into a link, but in docsify, if you add `:include` it will be embedded. +Normally, this will compiled into a link, but in docsify, if you add `:include` it will be embedded. You can use single or double quotation marks around as you like. External links can be used too - just replace the target. If you want to use a gist URL, see [Embed a gist](#embed-a-gist) section. diff --git a/src/core/render/utils.js b/src/core/render/utils.js index bd892c653..42fbfa078 100644 --- a/src/core/render/utils.js +++ b/src/core/render/utils.js @@ -23,8 +23,8 @@ export function getAndRemoveConfig(str = '') { if (str) { str = str - .replace(/^'/, '') - .replace(/'$/, '') + .replace(/^('|")/, '') + .replace(/('|")$/, '') .replace(/(?:^|\s):([\w-]+:?)=?([\w-%]+)?/g, (m, key, value) => { if (key.indexOf(':') === -1) { config[key] = (value && value.replace(/"/g, '')) || true; From baf5a8a4962656d8be8f714283064d2ea10c7e14 Mon Sep 17 00:00:00 2001 From: Koy Date: Fri, 25 Jun 2021 16:35:11 +0800 Subject: [PATCH 23/60] fix: upgrade dompurify from 2.2.8 to 2.2.9 (#1600) * fix: upgrade dompurify from 2.2.8 to 2.2.9 Snyk has created this PR to upgrade dompurify from 2.2.8 to 2.2.9. See this package in npm: https://www.npmjs.com/package/dompurify See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr * fix:fix dompurify. Co-authored-by: snyk-bot --- package-lock.json | 64 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4e6d46e5..6bac56990 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1099,9 +1099,9 @@ "integrity": "sha512-k1WGfKRQyhJpIr+P17O5vLIo2ko1PFLKwoetatdduUSt/aQ4J2sJrJwwatdI5Z3SiYk/mRH9S3JpdmMFd/IK4g==", "dev": true, "requires": { + "JSONStream": "^1.3.4", "bluebird": "^3.5.1", "figgy-pudding": "^3.4.1", - "JSONStream": "^1.3.4", "lru-cache": "^5.1.1", "make-fetch-happen": "^5.0.0", "npm-package-arg": "^6.1.0", @@ -4452,6 +4452,16 @@ "mz": "^2.5.0" } }, + "JSONStream": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" + } + }, "abab": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", @@ -6360,8 +6370,8 @@ "integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==", "dev": true, "requires": { - "is-text-path": "^1.0.1", "JSONStream": "^1.0.4", + "is-text-path": "^1.0.1", "lodash": "^4.17.15", "meow": "^7.0.0", "split2": "^2.0.0", @@ -7255,9 +7265,9 @@ } }, "dompurify": { - "version": "2.2.8", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.8.tgz", - "integrity": "sha512-9H0UL59EkDLgY3dUFjLV6IEUaHm5qp3mxSqWw7Yyx4Zhk2Jn2cmLe+CNPP3xy13zl8Bqg+0NehQzkdMoVhGRww==" + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.9.tgz", + "integrity": "sha512-+9MqacuigMIZ+1+EwoEltogyWGFTJZWU3258Rupxs+2CGs4H914G9er6pZbsme/bvb5L67o2rade9n21e4RW/w==" }, "domutils": { "version": "1.7.0", @@ -13221,16 +13231,6 @@ "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "dev": true }, - "JSONStream": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", - "dev": true, - "requires": { - "jsonparse": "^1.2.0", - "through": ">=2.2.7 <3" - } - }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -19078,23 +19078,6 @@ "limiter": "^1.0.5" } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - }, - "dependencies": { - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true - } - } - }, "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -19249,6 +19232,23 @@ } } }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "requires": { + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, "stringify-object": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", diff --git a/package.json b/package.json index f48bca253..8b9966dba 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "*.js": "eslint --fix" }, "dependencies": { - "dompurify": "^2.2.8", + "dompurify": "^2.2.9", "marked": "^1.2.9", "medium-zoom": "^1.0.6", "opencollective-postinstall": "^2.0.2", From 633f241547b03a337304773f6469f4cacd309515 Mon Sep 17 00:00:00 2001 From: luwol03 Date: Fri, 25 Jun 2021 17:26:27 +0200 Subject: [PATCH 24/60] added tests --- test/unit/render-util.test.js | 45 ++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/test/unit/render-util.test.js b/test/unit/render-util.test.js index 1f6996c2a..23f6f5938 100644 --- a/test/unit/render-util.test.js +++ b/test/unit/render-util.test.js @@ -1,4 +1,7 @@ -const { removeAtag } = require('../../src/core/render/utils'); +const { + removeAtag, + getAndRemoveConfig, +} = require('../../src/core/render/utils'); const { tree } = require(`../../src/core/render/tpl`); @@ -16,6 +19,46 @@ describe('core/render/utils', () => { expect(result).toEqual('content'); }); }); + + // getAndRemoveConfig() + // --------------------------------------------------------------------------- + describe('getAndRemoveConfig()', () => { + test('parse simple config', () => { + const result = getAndRemoveConfig( + `[filename](_media/example.md ':include')` + ); + + expect(result).toMatchObject({ + config: {}, + str: `[filename](_media/example.md ':include')`, + }); + }); + + test('parse config with arguments', () => { + const result = getAndRemoveConfig( + `[filename](_media/example.md ':include :foo=bar :baz test')` + ); + + expect(result).toMatchObject({ + config: { + foo: 'bar', + baz: true, + }, + str: `[filename](_media/example.md ':include test')`, + }); + }); + + test('parse config with double quotes', () => { + const result = getAndRemoveConfig( + `[filename](_media/example.md ":include")` + ); + + expect(result).toMatchObject({ + config: {}, + str: `[filename](_media/example.md ":include")`, + }); + }); + }); }); describe('core/render/tpl', () => { From 2840ac5d118a7dc1c87013b69fae5009345ced80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Sat, 26 Jun 2021 07:39:56 +0800 Subject: [PATCH 25/60] docs: Update docsify-updated to prevent replacement (#1574) Co-authored-by: Koy --- docs/write-a-plugin.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/write-a-plugin.md b/docs/write-a-plugin.md index baa894efe..3dae705ab 100644 --- a/docs/write-a-plugin.md +++ b/docs/write-a-plugin.md @@ -87,7 +87,7 @@ window.$docsify = { editHtml + html + '\n----\n' + - 'Last modified {docsify-updated} ' + + 'Last modified {docsify-updated}' + editHtml ); }); @@ -108,4 +108,5 @@ Current version: loading From 9d7dcd518d0ece1dc1e861e7120e712f815aad47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 09:25:55 +0800 Subject: [PATCH 26/60] chore: bump prismjs in /packages/docsify-server-renderer (#1607) Bumps [prismjs](https://github.com/PrismJS/prism) from 1.23.0 to 1.24.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](https://github.com/PrismJS/prism/compare/v1.23.0...v1.24.0) --- updated-dependencies: - dependency-name: prismjs dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../docsify-server-renderer/package-lock.json | 47 ++----------------- 1 file changed, 3 insertions(+), 44 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index ee64de857..14a46e07a 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -4,17 +4,6 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "clipboard": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.8.tgz", - "integrity": "sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ==", - "optional": true, - "requires": { - "good-listener": "^1.2.2", - "select": "^1.1.2", - "tiny-emitter": "^2.0.0" - } - }, "debug": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", @@ -23,12 +12,6 @@ "ms": "2.1.2" } }, - "delegate": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", - "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==", - "optional": true - }, "docsify": { "version": "4.12.1", "resolved": "https://registry.npmjs.org/docsify/-/docsify-4.12.1.tgz", @@ -49,15 +32,6 @@ "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.7.tgz", "integrity": "sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg==" }, - "good-listener": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", - "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", - "optional": true, - "requires": { - "delegate": "^3.1.2" - } - }, "marked": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/marked/-/marked-1.2.9.tgz", @@ -89,24 +63,15 @@ "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==" }, "prismjs": { - "version": "1.23.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.23.0.tgz", - "integrity": "sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA==", - "requires": { - "clipboard": "^2.0.0" - } + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.0.tgz", + "integrity": "sha512-SqV5GRsNqnzCL8k5dfAjCNhUrF3pR0A9lTDSCUZeh/LIshheXJEaP0hwLz2t4XHivd2J/v2HR+gRnigzeKe3cQ==" }, "resolve-pathname": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz", "integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==" }, - "select": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", - "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=", - "optional": true - }, "strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", @@ -115,12 +80,6 @@ "min-indent": "^1.0.0" } }, - "tiny-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", - "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", - "optional": true - }, "tinydate": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.3.0.tgz", From 97806cb7577957fbcb39dc2d34ff754a365fdad4 Mon Sep 17 00:00:00 2001 From: John Jago Date: Thu, 29 Jul 2021 21:18:00 -0500 Subject: [PATCH 27/60] docs: improve English wording (Getting Started/Customization) (#1617) While referencing the documentation, I noticed a few phrases that could be changed to sound more natural. I tried to keep the original meanings. --- docs/configuration.md | 22 +++++++++++----------- docs/cover.md | 2 +- docs/markdown.md | 4 ++-- docs/more-pages.md | 4 ++-- docs/plugins.md | 2 +- docs/quickstart.md | 2 +- docs/write-a-plugin.md | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 3ea277698..96ad8bc9c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -48,7 +48,7 @@ window.$docsify = { - Type: `String` - Default: `null` -Configure the repository url, or a string of `username/repo` can add the [GitHub Corner](http://tholman.com/github-corners/) widget in the top right corner of the site. +Configure the repository url, or a string of `username/repo`, to add the [GitHub Corner](http://tholman.com/github-corners/) widget in the top right corner of the site. ```js window.$docsify = { @@ -260,7 +260,7 @@ window.$docsify = { - Type: `String` -Website logo as it appears in the sidebar. You can resize it by using CSS. +Website logo as it appears in the sidebar. You can resize it using CSS. ```js window.$docsify = { @@ -337,7 +337,7 @@ window.$docsify = { - Type: `String` -Customize the theme color. Use [CSS3 variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables) feature and polyfill in old browser. +Customize the theme color. Use [CSS3 variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables) feature and polyfill in older browsers. ```js window.$docsify = { @@ -367,7 +367,7 @@ window.$docsify = { - type: `Boolean` -If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.md`, prepend a header to the page before converting it to HTML. Compare [#78](https://github.com/docsifyjs/docsify/issues/78). +If `loadSidebar` and `autoHeader` are both enabled, for each link in `_sidebar.md`, prepend a header to the page before converting it to HTML. See [#78](https://github.com/docsifyjs/docsify/issues/78). ```js window.$docsify = { @@ -380,7 +380,7 @@ window.$docsify = { - type: `Boolean` -Execute the script on the page. Only parse the first script tag([demo](themes)). If Vue is present, it is turned on by default. +Execute the script on the page. Only parse the first script tag ([demo](themes)). If Vue is present, it is turned on by default. ```js window.$docsify = { @@ -410,7 +410,7 @@ window.$docsify = { }; ``` -?> If this options is `false` but you don't want to emojify some specific colons , [Refer this](https://github.com/docsifyjs/docsify/issues/742#issuecomment-586313143) +?> If this option is `false` but you don't want to emojify some specific colons, [refer to this](https://github.com/docsifyjs/docsify/issues/742#issuecomment-586313143) ## mergeNavbar @@ -497,8 +497,8 @@ window.$docsify = { - type: `Array` -When `routerMode: 'history'`, you may face the cross-origin issues, See [#1379](https://github.com/docsifyjs/docsify/issues/1379). -In Markdown content, there is a simple way to solve it, see extends Markdown syntax `Cross-Origin link` in [helpers](helpers.md). +When `routerMode: 'history'`, you may face cross-origin issues. See [#1379](https://github.com/docsifyjs/docsify/issues/1379). +In Markdown content, there is a simple way to solve it: see extends Markdown syntax `Cross-Origin link` in [helpers](helpers.md). ```js window.$docsify = { @@ -570,7 +570,7 @@ window.$docsify = { - type: `Array` -List of languages that will fallback to the default language when a page is requested and it doesn't exist for the given local. +List of languages that will fallback to the default language when a page is requested and it doesn't exist for the given locale. Example: @@ -615,14 +615,14 @@ window.$docsify = { }; ``` -> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options. +> Note: The options for fallbackLanguages don't work with the `notFoundPage` options. ## topMargin - type: `Number` - default: `0` -Adds a space on top when scrolling content page to reach the selected section. This is useful in case you have a _sticky-header_ layout and you want to align anchors to the end of your header. +Adds a space on top when scrolling the content page to reach the selected section. This is useful in case you have a _sticky-header_ layout and you want to align anchors to the end of your header. ```js window.$docsify = { diff --git a/docs/cover.md b/docs/cover.md index a8da3083d..bf8c3c54e 100644 --- a/docs/cover.md +++ b/docs/cover.md @@ -1,6 +1,6 @@ # Cover -Activate the cover feature by setting `coverpage` to **true**, compare [coverpage configuration](configuration.md#coverpage). +Activate the cover feature by setting `coverpage` to **true**. See [coverpage configuration](configuration.md#coverpage). ## Basic usage diff --git a/docs/markdown.md b/docs/markdown.md index c506e17c5..fef036e96 100644 --- a/docs/markdown.md +++ b/docs/markdown.md @@ -15,9 +15,9 @@ window.$docsify = { } ``` -?> Configuration Options Reference [marked documentation](https://marked.js.org/#/USING_ADVANCED.md) +?> Configuration Options Reference: [marked documentation](https://marked.js.org/#/USING_ADVANCED.md) -Even you can completely customize the parsing rules. +You can completely customize the parsing rules. ```js window.$docsify = { diff --git a/docs/more-pages.md b/docs/more-pages.md index 0f9386848..bf84a980e 100644 --- a/docs/more-pages.md +++ b/docs/more-pages.md @@ -25,7 +25,7 @@ docs/zh-cn/guide.md => http://domain.com/#/zh-cn/guide ## Sidebar -In order to have sidebar, then you can create your own `_sidebar.md` (see [this documentation's sidebar](https://github.com/docsifyjs/docsify/blob/master/docs/_sidebar.md) for an example): +In order to have a sidebar, you can create your own `_sidebar.md` (see [this documentation's sidebar](https://github.com/docsifyjs/docsify/blob/master/docs/_sidebar.md) for an example): First, you need to set `loadSidebar` to **true**. Details are available in the [configuration paragraph](configuration.md#loadsidebar). @@ -65,7 +65,7 @@ Example file structure: ## Nested Sidebars -You may want the sidebar to update with only navigation to reflect the current directory. This can be done by adding a `_sidebar.md` file to each folder. +You may want the sidebar to update after navigation to reflect the current directory. This can be done by adding a `_sidebar.md` file to each folder. `_sidebar.md` is loaded from each level directory. If the current directory doesn't have `_sidebar.md`, it will fall back to the parent directory. If, for example, the current path is `/guide/quick-start`, the `_sidebar.md` will be loaded from `/guide/_sidebar.md`. diff --git a/docs/plugins.md b/docs/plugins.md index c128c4f30..b7ccb971f 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -123,7 +123,7 @@ Exclude the special image ## Edit on github -Add `Edit on github` button on every pages. Provided by [@njleonzhang](https://github.com/njleonzhang), check [document](https://github.com/njleonzhang/docsify-edit-on-github) +Add `Edit on github` button on every pages. Provided by [@njleonzhang](https://github.com/njleonzhang), see this [document](https://github.com/njleonzhang/docsify-edit-on-github) ## Demo code with instant preview and jsfiddle integration diff --git a/docs/quickstart.md b/docs/quickstart.md index 430550b93..e5da5e2b3 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -81,7 +81,7 @@ If you prefer to lock docsify to a specific version, specify the full version af ### Manually preview your site -If you installed python on your system, you can easily use it to run a static server to preview your site. +If you have Python installed on your system, you can easily use it to run a static server to preview your site. ```python2 cd docs && python -m SimpleHTTPServer 3000 diff --git a/docs/write-a-plugin.md b/docs/write-a-plugin.md index 3dae705ab..0d605add8 100644 --- a/docs/write-a-plugin.md +++ b/docs/write-a-plugin.md @@ -49,7 +49,7 @@ window.$docsify = { #### footer -Add footer component in each pages. +Add a footer component to each page. ```js window.$docsify = { From c0bf897ea46a14cc3abe1cf1e6f7b7e4e8ba2877 Mon Sep 17 00:00:00 2001 From: John Jago Date: Fri, 30 Jul 2021 11:37:52 -0500 Subject: [PATCH 28/60] docs: improve English wording (Guide) This change improves a few of the phrases so that they sound more natural. Small stylistic changes are also included, such as consistent use of "GitHub" instead of "Github". --- docs/_sidebar.md | 4 ++-- docs/deploy.md | 38 +++++++++++++++++++------------------- docs/embed-files.md | 6 +++--- docs/helpers.md | 14 +++++++------- docs/pwa.md | 8 ++++---- docs/ssr.md | 8 ++++---- docs/vue.md | 2 +- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 051514bcb..2483fef8f 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -20,8 +20,8 @@ - [Helpers](helpers.md) - [Vue compatibility](vue.md) - [CDN](cdn.md) - - [Offline Mode(PWA)](pwa.md) - - [Server-Side Rendering(SSR)](ssr.md) + - [Offline Mode (PWA)](pwa.md) + - [Server-Side Rendering (SSR)](ssr.md) - [Embed Files](embed-files.md) - [Awesome docsify](awesome.md) diff --git a/docs/deploy.md b/docs/deploy.md index aac87df21..4072b404b 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -4,22 +4,22 @@ Similar to [GitBook](https://www.gitbook.com), you can deploy files to GitHub Pa ## GitHub Pages -There're three places to populate your docs for your Github repository: +There are three places to populate your docs for your GitHub repository: - `docs/` folder - master branch - gh-pages branch -It is recommended that you save your files to the `./docs` subfolder of the `master` branch of your repository. Then select `master branch /docs folder` as your Github Pages source in your repositories' settings page. +It is recommended that you save your files to the `./docs` subfolder of the `master` branch of your repository. Then select `master branch /docs folder` as your GitHub Pages source in your repository's settings page. -![github pages](_images/deploy-github-pages.png) +![GitHub Pages](_images/deploy-github-pages.png) !> You can also save files in the root directory and select `master branch`. You'll need to place a `.nojekyll` file in the deploy location (such as `/docs` or the gh-pages branch) ## GitLab Pages -If you are deploying your master branch, include `.gitlab-ci.yml` with the following script: +If you are deploying your master branch, create a `.gitlab-ci.yml` with the following script: ?> The `.public` workaround is so `cp` doesn't also copy `public/` to itself in an infinite loop. @@ -43,9 +43,9 @@ pages: !> You'll need to install the Firebase CLI using `npm i -g firebase-tools` after signing into the [Firebase Console](https://console.firebase.google.com) using a Google Account. -Using Terminal determine and navigate to the directory for your Firebase Project - this could be `~/Projects/Docs` etc. From there, run `firebase init`, choosing `Hosting` from the menu (use **space** to select, **arrow keys** to change options and **enter** to confirm). Follow the setup instructions. +Using a terminal, determine and navigate to the directory for your Firebase Project. This could be `~/Projects/Docs`, etc. From there, run `firebase init` and choose `Hosting` from the menu (use **space** to select, **arrow keys** to change options and **enter** to confirm). Follow the setup instructions. -You should have your `firebase.json` file looking similar to this (I changed the deployment directory from `public` to `site`): +Your `firebase.json` file should look similar to this (I changed the deployment directory from `public` to `site`): ```json { @@ -56,11 +56,11 @@ You should have your `firebase.json` file looking similar to this (I changed the } ``` -Once finished, build the starting template by running `docsify init ./site` (replacing site with the deployment directory you determined when running `firebase init` - public by default). Add/edit the documentation, then run `firebase deploy` from the base project directory. +Once finished, build the starting template by running `docsify init ./site` (replacing site with the deployment directory you determined when running `firebase init` - public by default). Add/edit the documentation, then run `firebase deploy` from the root project directory. ## VPS -Try following nginx config. +Use the following nginx config. ```nginx server { @@ -78,11 +78,11 @@ server { 1. Login to your [Netlify](https://www.netlify.com/) account. 2. In the [dashboard](https://app.netlify.com/) page, click **New site from Git**. -3. Choose a repository where you store your docs, leave the **Build Command** area blank, fill in the Publish directory area with the directory of your `index.html`, for example it should be docs if you populated it at `docs/index.html`. +3. Choose a repository where you store your docs, leave the **Build Command** area blank, and fill in the Publish directory area with the directory of your `index.html`. For example, it should be docs if you populated it at `docs/index.html`. ### HTML5 router -When using the HTML5 router, you need to set up redirect rules that redirect all requests to your `index.html`, it's pretty simple when you're using Netlify, create a file named `_redirects` in the docs directory, add this snippet to the file and you're all set: +When using the HTML5 router, you need to set up redirect rules that redirect all requests to your `index.html`. It's pretty simple when you're using Netlify. Just create a file named `_redirects` in the docs directory, add this snippet to the file, and you're all set: ```sh /* /index.html 200 @@ -117,7 +117,7 @@ version: 0.1 frontend: phases: build: - commands: + commands: - echo "Nothing to build" artifacts: baseDirectory: /docs @@ -128,20 +128,20 @@ frontend: ``` -6. Add the following Redirect rules in their displayed order. Note that the second record is a PNG image where you can change it with any image format you are using. +6. Add the following Redirect rules in their displayed order. Note that the second record is a PNG image where you can change it with any image format you are using. | Source address | Target address | Type | |----------------|----------------|---------------| | /<*>.md | /<*>.md | 200 (Rewrite) | | /<*>.png | /<*>.png | 200 (Rewrite) | -| /<*> | /index.html | 200 (Rewrite) | +| /<*> | /index.html | 200 (Rewrite) | ## Docker -- Create docsify files +- Create docsify files - You need prepare the initial files instead of making in container. + You need prepare the initial files instead of making them inside the container. See the [Quickstart](https://docsify.js.org/#/quickstart) section for instructions on how to create these files manually or using [docsify-cli](https://github.com/docsifyjs/docsify-cli). ```sh @@ -149,7 +149,7 @@ frontend: README.md ``` -- Create dockerfile +- Create Dockerfile ```Dockerfile FROM node:latest @@ -158,10 +158,10 @@ frontend: RUN npm install -g docsify-cli@latest EXPOSE 3000/tcp ENTRYPOINT docsify serve . - + ``` - So, current directory structure should be this: + The current directory structure should be this: ```sh index.html @@ -178,6 +178,6 @@ frontend: - Run docker image ```sh - docker run -itp 3000:3000 --name=docsify -v $(pwd):/docs docsify/demo + docker run -itp 3000:3000 --name=docsify -v $(pwd):/docs docsify/demo ``` diff --git a/docs/embed-files.md b/docs/embed-files.md index 480d5fc5f..936494bcb 100644 --- a/docs/embed-files.md +++ b/docs/embed-files.md @@ -10,13 +10,13 @@ For example, here is an embedded Markdown file. You only need to do this: [filename](_media/example.md ':include') ``` -Then the content of `example.md` will be displayed directly here; +Then the content of `example.md` will be displayed directly here: [filename](_media/example.md ':include') You can check the original content for [example.md](_media/example.md ':ignore'). -Normally, this will compiled into a link, but in docsify, if you add `:include` it will be embedded. You can use single or double quotation marks around as you like. +Normally, this will be compiled into a link, but in docsify, if you add `:include` it will be embedded. You can use single or double quotation marks around as you like. External links can be used too - just replace the target. If you want to use a gist URL, see [Embed a gist](#embed-a-gist) section. @@ -73,7 +73,7 @@ Example: If you embed the file as `iframe`, `audio` and `video`, then you may need to set the attributes of these tags. -?> Note, for the `audio` and `video` types, docsify adds the `controls` attribute by default. When you want add more attributes, the `controls` attribute need to be added manually if need be. +?> Note, for the `audio` and `video` types, docsify adds the `controls` attribute by default. When you want add more attributes, the `controls` attribute need to be added manually if need be. ```md [filename](_media/example.mp4 ':include :type=video controls width=100%') ``` diff --git a/docs/helpers.md b/docs/helpers.md index 46ff81d32..6bd8a069d 100644 --- a/docs/helpers.md +++ b/docs/helpers.md @@ -2,7 +2,7 @@ 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. +> Note: For the special code syntax cases, it's better to put them within code backticks to avoid any conflict from configurations or emojis. ## Important content @@ -30,13 +30,13 @@ are rendered as: ## Ignore to compile link -Some time we will put some other relative path to the link, you have to need to tell docsify you don't need to compile this link. For example +Sometimes we will use some other relative path for the link, and we have to tell docsify that we don't need to compile this link. For example: ```md [link](/demo/) ``` -It will be compiled to `link` and will be loaded `/demo/README.md`. Maybe you want to jump to `/demo/index.html`. +It will be compiled to `link` and will load `/demo/README.md`. Maybe you want to jump to `/demo/index.html`. Now you can do that @@ -44,7 +44,7 @@ Now you can do that [link](/demo/ ':ignore') ``` -You will get `link`html. Do not worry, you can still set title for link. +You will get `link`html. Do not worry, you can still set the title for the link. ```md [link](/demo/ ':ignore title') @@ -67,13 +67,13 @@ You will get `link`html. Do not worry, you can still set ti ## Cross-Origin link -Only when you both set the `routerMode: 'history'` and `externalLinkTarget: '_self'`, you need add this configuration for those Cross-Origin links. +Only when you set both the `routerMode: 'history'` and `externalLinkTarget: '_self'`, you need to add this configuration for those Cross-Origin links. ```md [example.com](https://example.com/ ':crossorgin') ``` -## Github Task Lists +## GitHub Task Lists ```md - [ ] foo @@ -150,7 +150,7 @@ This is useful for rendering markdown content in the details element. -Or markdown content can be wrapped in html tag. +Markdown content can also be wrapped in html tags. ```markdown
diff --git a/docs/pwa.md b/docs/pwa.md index b104d344f..3caca1122 100644 --- a/docs/pwa.md +++ b/docs/pwa.md @@ -2,11 +2,11 @@ [Progressive Web Apps](https://developers.google.com/web/progressive-web-apps/) (PWA) are experiences that combine the best of the web with the best of apps. We can enhance our website with service workers to work **offline** or on low-quality networks. -It is also very easy to use it. +It is also very easy to use. ## Create serviceWorker -Create a `sw.js` file in your documents root directory and copy the following code: +Create a `sw.js` file in your project's root directory and copy the following code: *sw.js* @@ -98,7 +98,7 @@ self.addEventListener('fetch', event => { ## Register -Now, register it in your `index.html`. It only works on some modern browsers, so we need to judge: +Now, register it in your `index.html`. It only works on some modern browsers, so we need to check: *index.html* @@ -112,4 +112,4 @@ Now, register it in your `index.html`. It only works on some modern browsers, so ## Enjoy it -Release your website and start experiencing magical offline feature. :ghost: You can turn off Wi-Fi and refresh the current site to experience it. +Release your website and start experiencing the magical offline feature. :ghost: You can turn off Wi-Fi and refresh the current site to experience it. diff --git a/docs/ssr.md b/docs/ssr.md index 3e3b9a579..35488a7e9 100644 --- a/docs/ssr.md +++ b/docs/ssr.md @@ -16,7 +16,7 @@ Install `now` and `docsify-cli` in your project. npm i now docsify-cli -D ``` -Edit `package.json`. If the documentation in `./docs` subdirectory. +Edit `package.json`. The below assumes the documentation is in the `./docs` subdirectory. ```json { @@ -42,7 +42,7 @@ Edit `package.json`. If the documentation in `./docs` subdirectory. !> The `basePath` just like webpack `publicPath`. We can use local or remote files. -We can preview in the local to see if it works. +We can preview the local site to see if it works. ```bash npm start @@ -56,11 +56,11 @@ Publish it! now -p ``` -Now, You have a support for SSR the docs site. +Now, you have support for SSR. ## Custom template -You can provide a template for entire page's HTML. such as +You can provide a template for an entire page's HTML, such as ```html diff --git a/docs/vue.md b/docs/vue.md index 2e61e6ec5..57a760127 100644 --- a/docs/vue.md +++ b/docs/vue.md @@ -1,6 +1,6 @@ # Vue compatibility -Docsify allows Vue content to be added directly to you markdown pages. This can greatly simplify working with data and adding reactivity to your site. +Docsify allows Vue content to be added directly to your markdown pages. This can greatly simplify working with data and adding reactivity to your site. To get started, add Vue [2.x](https://vuejs.org) or [3.x](https://v3.vuejs.org) to your `index.html` file. Choose the production version for your live site or the development version for helpful console warnings and [Vue.js devtools](https://github.com/vuejs/vue-devtools) support. From 691c3e4048becf32c6ac46f2bf1ad2f68557866e Mon Sep 17 00:00:00 2001 From: John Jago Date: Fri, 30 Jul 2021 18:15:12 -0500 Subject: [PATCH 29/60] test: update sidebar snapshot --- test/integration/__snapshots__/docs.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/__snapshots__/docs.test.js.snap b/test/integration/__snapshots__/docs.test.js.snap index 3c741042d..da8c0e1f5 100644 --- a/test/integration/__snapshots__/docs.test.js.snap +++ b/test/integration/__snapshots__/docs.test.js.snap @@ -9,4 +9,4 @@ exports[`Docs Site coverpage renders and is unchanged 1`] = ` exports[`Docs Site navbar renders and is unchanged 1`] = `""`; -exports[`Docs Site sidebar renders and is unchanged 1`] = `""`; +exports[`Docs Site sidebar renders and is unchanged 1`] = `""`; From b07fa3cc8323e63dd7b105c7e29b2e1914f5c117 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Tue, 3 Aug 2021 13:18:22 +0300 Subject: [PATCH 30/60] fix: upgrade dompurify from 2.2.9 to 2.3.0 (#1616) * fix: upgrade dompurify from 2.2.9 to 2.3.0 Snyk has created this PR to upgrade dompurify from 2.2.9 to 2.3.0. See this package in npm: https://www.npmjs.com/package/dompurify See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr * fix: missing vue. * Update package-lock.json * Update package-lock.json Co-authored-by: Koy --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6bac56990..ec0469e76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7265,9 +7265,9 @@ } }, "dompurify": { - "version": "2.2.9", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.9.tgz", - "integrity": "sha512-+9MqacuigMIZ+1+EwoEltogyWGFTJZWU3258Rupxs+2CGs4H914G9er6pZbsme/bvb5L67o2rade9n21e4RW/w==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.0.tgz", + "integrity": "sha512-VV5C6Kr53YVHGOBKO/F86OYX6/iLTw2yVSI721gKetxpHCK/V5TaLEf9ODjRgl1KLSWRMY6cUhAbv/c+IUnwQw==" }, "domutils": { "version": "1.7.0", diff --git a/package.json b/package.json index 8b9966dba..984f8721d 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "*.js": "eslint --fix" }, "dependencies": { - "dompurify": "^2.2.9", + "dompurify": "^2.3.0", "marked": "^1.2.9", "medium-zoom": "^1.0.6", "opencollective-postinstall": "^2.0.2", From 66303fec4c7115621e556ad742cfac9d19f26bd9 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Wed, 4 Aug 2021 05:44:08 +0300 Subject: [PATCH 31/60] fix: upgrade dompurify from 2.2.7 to 2.3.0 (#1619) Snyk has created this PR to upgrade dompurify from 2.2.7 to 2.3.0. See this package in npm: https://www.npmjs.com/package/dompurify See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/6efe7e04-4e52-497e-8ad5-570733cc577a?utm_source=github&utm_medium=upgrade-pr --- packages/docsify-server-renderer/package-lock.json | 6 +++--- packages/docsify-server-renderer/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index 14a46e07a..28f0b1a3f 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -28,9 +28,9 @@ } }, "dompurify": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.2.7.tgz", - "integrity": "sha512-jdtDffdGNY+C76jvodNTu9jt5yYj59vuTUyx+wXdzcSwAGTYZDAQkQ7Iwx9zcGrA4ixC1syU4H3RZROqRxokxg==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.0.tgz", + "integrity": "sha512-VV5C6Kr53YVHGOBKO/F86OYX6/iLTw2yVSI721gKetxpHCK/V5TaLEf9ODjRgl1KLSWRMY6cUhAbv/c+IUnwQw==" }, "marked": { "version": "1.2.9", diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index 82197b8eb..57ddec989 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -17,7 +17,7 @@ "dependencies": { "debug": "^4.3.2", "docsify": "^4.12.1", - "dompurify": "^2.2.7", + "dompurify": "^2.3.0", "node-fetch": "^2.6.0", "resolve-pathname": "^3.0.0" } From 72485a38c12e3508af7ccf25b41ce9e9b72dc5b0 Mon Sep 17 00:00:00 2001 From: Aarav Borthakur <69025547+gadhagod@users.noreply.github.com> Date: Fri, 27 Aug 2021 03:34:34 -0700 Subject: [PATCH 32/60] docs: Add dynamic code block highlighting documentation (#1626) --- docs/language-highlight.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/language-highlight.md b/docs/language-highlight.md index 1e089c10d..1956af71f 100644 --- a/docs/language-highlight.md +++ b/docs/language-highlight.md @@ -51,3 +51,13 @@ function getAdder(int $x): int return 123; } ``` + +## Highlighting Dynamic Content +Code blocks [dynamically created from javascript](https://docsify.js.org/#/configuration?id=executescript) can be highlighted using the method `Prism.highlightElement` like so: + +```javascript +var code = document.createElement("code"); +code.innerHTML = "console.log('Hello World!')"; +code.setAttribute("class", "lang-javascript"); +Prism.highlightElement(code); +``` From ee8cb8a8375bd304dbf008756fb425142b1ca557 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Sep 2021 09:53:32 +0800 Subject: [PATCH 33/60] chore: bump tar from 4.4.13 to 4.4.15 (#1620) Bumps [tar](https://github.com/npm/node-tar) from 4.4.13 to 4.4.15. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/node-tar/compare/v4.4.13...v4.4.15) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Koy --- package-lock.json | 96 +++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/package-lock.json b/package-lock.json index ec0469e76..1735a15ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4347,37 +4347,37 @@ } }, "@vue/compiler-core": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.0.11.tgz", - "integrity": "sha512-6sFj6TBac1y2cWCvYCA8YzHJEbsVkX7zdRs/3yK/n1ilvRqcn983XvpBbnN3v4mZ1UiQycTvOiajJmOgN9EVgw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.1.5.tgz", + "integrity": "sha512-TXBhFinoBaXKDykJzY26UEuQU1K07FOp/0Ie+OXySqqk0bS0ZO7Xvl7UmiTUPYcLrWbxWBR7Bs/y55AI0MNc2Q==", "dev": true, "requires": { "@babel/parser": "^7.12.0", "@babel/types": "^7.12.0", - "@vue/shared": "3.0.11", + "@vue/shared": "3.1.5", "estree-walker": "^2.0.1", "source-map": "^0.6.1" }, "dependencies": { "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", + "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==", "dev": true }, "@babel/parser": { - "version": "7.14.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.3.tgz", - "integrity": "sha512-7MpZDIfI7sUC5zWo2+foJ50CSI5lcqDehZ0lVgIhSi4bFEk94fLAKlF3Q0nzSQQ+ca0lm+O6G9ztKVBeu8PMRQ==", + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.9.tgz", + "integrity": "sha512-RdUTOseXJ8POjjOeEBEvNMIZU/nm4yu2rufRkcibzkkg7DmQvXU8v3M4Xk9G7uuI86CDGkKcuDWgioqZm+mScQ==", "dev": true }, "@babel/types": { - "version": "7.14.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz", - "integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==", + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.9.tgz", + "integrity": "sha512-u0bLTnv3DFHeaQLYzb7oRJ1JHr1sv/SYDM7JSqHFFLwXG1wTZRughxFI5NCP8qBEo1rVVsn7Yg2Lvw49nne/Ow==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.14.0", + "@babel/helper-validator-identifier": "^7.14.9", "to-fast-properties": "^2.0.0" } }, @@ -4396,49 +4396,49 @@ } }, "@vue/compiler-dom": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.0.11.tgz", - "integrity": "sha512-+3xB50uGeY5Fv9eMKVJs2WSRULfgwaTJsy23OIltKgMrynnIj8hTYY2UL97HCoz78aDw1VDXdrBQ4qepWjnQcw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.1.5.tgz", + "integrity": "sha512-ZsL3jqJ52OjGU/YiT/9XiuZAmWClKInZM2aFJh9gnsAPqOrj2JIELMbkIFpVKR/CrVO/f2VxfPiiQdQTr65jcQ==", "dev": true, "requires": { - "@vue/compiler-core": "3.0.11", - "@vue/shared": "3.0.11" + "@vue/compiler-core": "3.1.5", + "@vue/shared": "3.1.5" } }, "@vue/reactivity": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.0.11.tgz", - "integrity": "sha512-SKM3YKxtXHBPMf7yufXeBhCZ4XZDKP9/iXeQSC8bBO3ivBuzAi4aZi0bNoeE2IF2iGfP/AHEt1OU4ARj4ao/Xw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.5.tgz", + "integrity": "sha512-1tdfLmNjWG6t/CsPldh+foumYFo3cpyCHgBYQ34ylaMsJ+SNHQ1kApMIa8jN+i593zQuaw3AdWH0nJTARzCFhg==", "dev": true, "requires": { - "@vue/shared": "3.0.11" + "@vue/shared": "3.1.5" } }, "@vue/runtime-core": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.0.11.tgz", - "integrity": "sha512-87XPNwHfz9JkmOlayBeCCfMh9PT2NBnv795DSbi//C/RaAnc/bGZgECjmkD7oXJ526BZbgk9QZBPdFT8KMxkAg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.1.5.tgz", + "integrity": "sha512-YQbG5cBktN1RowQDKA22itmvQ+b40f0WgQ6CXK4VYoYICAiAfu6Cc14777ve8zp1rJRGtk5oIeS149TOculrTg==", "dev": true, "requires": { - "@vue/reactivity": "3.0.11", - "@vue/shared": "3.0.11" + "@vue/reactivity": "3.1.5", + "@vue/shared": "3.1.5" } }, "@vue/runtime-dom": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.0.11.tgz", - "integrity": "sha512-jm3FVQESY3y2hKZ2wlkcmFDDyqaPyU3p1IdAX92zTNeCH7I8zZ37PtlE1b9NlCtzV53WjB4TZAYh9yDCMIEumA==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.1.5.tgz", + "integrity": "sha512-tNcf3JhVR0RfW0kw1p8xZgv30nvX8Y9rsz7eiQ0dHe273sfoCngAG0y4GvMaY4Xd8FsjUwFedd4suQ8Lu8meXg==", "dev": true, "requires": { - "@vue/runtime-core": "3.0.11", - "@vue/shared": "3.0.11", + "@vue/runtime-core": "3.1.5", + "@vue/shared": "3.1.5", "csstype": "^2.6.8" } }, "@vue/shared": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.0.11.tgz", - "integrity": "sha512-b+zB8A2so8eCE0JsxjL24J7vdGl8rzPQ09hZNhystm+KqSbKcAej1A+Hbva1rCMmTTqA+hFnUSDc5kouEo0JzA==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.5.tgz", + "integrity": "sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA==", "dev": true }, "@zkochan/cmd-shim": { @@ -19480,9 +19480,9 @@ } }, "tar": { - "version": "4.4.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", - "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "version": "4.4.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.15.tgz", + "integrity": "sha512-ItbufpujXkry7bHH9NpQyTXPbJ72iTlXgkBAYsAjDXk3Ds8t/3NfO5P4xZGy7u+sYuQUbimgzswX4uQIEeNVOA==", "dev": true, "requires": { "chownr": "^1.1.1", @@ -20249,20 +20249,20 @@ "dev": true }, "vue2": { - "version": "npm:vue@2.6.12", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.12.tgz", - "integrity": "sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg==", + "version": "npm:vue@2.6.14", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.14.tgz", + "integrity": "sha512-x2284lgYvjOMj3Za7kqzRcUSxBboHqtgRE2zlos1qWaOye5yUmHn42LB1250NJBLRwEcdrB0JRwyPTEPhfQjiQ==", "dev": true }, "vue3": { - "version": "npm:vue@3.0.11", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.0.11.tgz", - "integrity": "sha512-3/eUi4InQz8MPzruHYSTQPxtM3LdZ1/S/BvaU021zBnZi0laRUyH6pfuE4wtUeLvI8wmUNwj5wrZFvbHUXL9dw==", + "version": "npm:vue@3.1.5", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.1.5.tgz", + "integrity": "sha512-Ho7HNb1nfDoO+HVb6qYZgeaobt1XbY6KXFe4HGs1b9X6RhkWG/113n4/SrtM1LUclM6OrP/Se5aPHHvAPG1iVQ==", "dev": true, "requires": { - "@vue/compiler-dom": "3.0.11", - "@vue/runtime-dom": "3.0.11", - "@vue/shared": "3.0.11" + "@vue/compiler-dom": "3.1.5", + "@vue/runtime-dom": "3.1.5", + "@vue/shared": "3.1.5" } }, "w3c-hr-time": { From c53da0c4b6e269569a5e307ca2739db42b4f6794 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Sep 2021 11:01:02 +0800 Subject: [PATCH 34/60] chore: bump tar from 4.4.15 to 4.4.19 (#1630) Bumps [tar](https://github.com/npm/node-tar) from 4.4.15 to 4.4.19. - [Release notes](https://github.com/npm/node-tar/releases) - [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/node-tar/compare/v4.4.15...v4.4.19) --- updated-dependencies: - dependency-name: tar dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 110 +++++++++++++++++++++++++--------------------- 1 file changed, 59 insertions(+), 51 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1735a15ed..aa445aa7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4347,15 +4347,15 @@ } }, "@vue/compiler-core": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.1.5.tgz", - "integrity": "sha512-TXBhFinoBaXKDykJzY26UEuQU1K07FOp/0Ie+OXySqqk0bS0ZO7Xvl7UmiTUPYcLrWbxWBR7Bs/y55AI0MNc2Q==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.2.7.tgz", + "integrity": "sha512-OcWy72QNTkcNYtZIb927pRx2cRujrlDWsAx7ejWDnRzwo83gIyF8NeTrMv/7wbnHoeA+Gga9AK4Wo9PlCzhuLg==", "dev": true, "requires": { - "@babel/parser": "^7.12.0", - "@babel/types": "^7.12.0", - "@vue/shared": "3.1.5", - "estree-walker": "^2.0.1", + "@babel/parser": "^7.15.0", + "@babel/types": "^7.15.0", + "@vue/shared": "3.2.7", + "estree-walker": "^2.0.2", "source-map": "^0.6.1" }, "dependencies": { @@ -4366,15 +4366,15 @@ "dev": true }, "@babel/parser": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.9.tgz", - "integrity": "sha512-RdUTOseXJ8POjjOeEBEvNMIZU/nm4yu2rufRkcibzkkg7DmQvXU8v3M4Xk9G7uuI86CDGkKcuDWgioqZm+mScQ==", + "version": "7.15.3", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.3.tgz", + "integrity": "sha512-O0L6v/HvqbdJawj0iBEfVQMc3/6WP+AeOsovsIgBFyJaG+W2w7eqvZB7puddATmWuARlm1SX7DwxJ/JJUnDpEA==", "dev": true }, "@babel/types": { - "version": "7.14.9", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.9.tgz", - "integrity": "sha512-u0bLTnv3DFHeaQLYzb7oRJ1JHr1sv/SYDM7JSqHFFLwXG1wTZRughxFI5NCP8qBEo1rVVsn7Yg2Lvw49nne/Ow==", + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.0.tgz", + "integrity": "sha512-OBvfqnllOIdX4ojTHpwZbpvz4j3EWyjkZEdmjH0/cgsd6QOdSgU8rLSk6ard/pcW7rlmjdVSX/AWOaORR1uNOQ==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.14.9", @@ -4396,49 +4396,49 @@ } }, "@vue/compiler-dom": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.1.5.tgz", - "integrity": "sha512-ZsL3jqJ52OjGU/YiT/9XiuZAmWClKInZM2aFJh9gnsAPqOrj2JIELMbkIFpVKR/CrVO/f2VxfPiiQdQTr65jcQ==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.2.7.tgz", + "integrity": "sha512-YZyZNoZlTbTMqyY8QMC8IhwmcDVOiE1DdVwjnXbyihg+XVqpGQkDjNcG5nyMTbtZDKXREsYkcjaZntEfKyWK5g==", "dev": true, "requires": { - "@vue/compiler-core": "3.1.5", - "@vue/shared": "3.1.5" + "@vue/compiler-core": "3.2.7", + "@vue/shared": "3.2.7" } }, "@vue/reactivity": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.5.tgz", - "integrity": "sha512-1tdfLmNjWG6t/CsPldh+foumYFo3cpyCHgBYQ34ylaMsJ+SNHQ1kApMIa8jN+i593zQuaw3AdWH0nJTARzCFhg==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.2.7.tgz", + "integrity": "sha512-VDeQiZs6s5m1W7hIX+vzmokDCHPEKNYrSxoHWXj4MiGamcT5XZxACj/VXOCK9c6qz36qK5EQOfDWtmVhxfI2hQ==", "dev": true, "requires": { - "@vue/shared": "3.1.5" + "@vue/shared": "3.2.7" } }, "@vue/runtime-core": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.1.5.tgz", - "integrity": "sha512-YQbG5cBktN1RowQDKA22itmvQ+b40f0WgQ6CXK4VYoYICAiAfu6Cc14777ve8zp1rJRGtk5oIeS149TOculrTg==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.2.7.tgz", + "integrity": "sha512-vY3XwE671KDFf4onRrQZdRmkT+0Jr6wrifTO+JwrB6Q9hNiB064TgmiBXqoovjuQW5BmJw5Lkz3u+pG8FE8Egw==", "dev": true, "requires": { - "@vue/reactivity": "3.1.5", - "@vue/shared": "3.1.5" + "@vue/reactivity": "3.2.7", + "@vue/shared": "3.2.7" } }, "@vue/runtime-dom": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.1.5.tgz", - "integrity": "sha512-tNcf3JhVR0RfW0kw1p8xZgv30nvX8Y9rsz7eiQ0dHe273sfoCngAG0y4GvMaY4Xd8FsjUwFedd4suQ8Lu8meXg==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.2.7.tgz", + "integrity": "sha512-yuUmc8haFHrDqoU10JV3Fjd3G5Wz/ID+a/XMs0U68vhDLFsTBejhLX4il8Ga8nv+wrdwuGFwEE8t6APS67PxyA==", "dev": true, "requires": { - "@vue/runtime-core": "3.1.5", - "@vue/shared": "3.1.5", + "@vue/runtime-core": "3.2.7", + "@vue/shared": "3.2.7", "csstype": "^2.6.8" } }, "@vue/shared": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.5.tgz", - "integrity": "sha512-oJ4F3TnvpXaQwZJNF3ZK+kLPHKarDmJjJ6jyzVNDKH9md1dptjC7lWR//jrGuLdek/U6iltWxqAnYOu8gCiOvA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.2.7.tgz", + "integrity": "sha512-YwGOcNZjOY/MmadpzFBXWyHEwZSf0lVU4XF5zpD7tXC9dmqjdo38Jkk06wATu4LYHDPW4emXKMB5YLFPWPkwFA==", "dev": true }, "@zkochan/cmd-shim": { @@ -19480,18 +19480,26 @@ } }, "tar": { - "version": "4.4.15", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.15.tgz", - "integrity": "sha512-ItbufpujXkry7bHH9NpQyTXPbJ72iTlXgkBAYsAjDXk3Ds8t/3NfO5P4xZGy7u+sYuQUbimgzswX4uQIEeNVOA==", + "version": "4.4.19", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", + "integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==", "dev": true, "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" + "chownr": "^1.1.4", + "fs-minipass": "^1.2.7", + "minipass": "^2.9.0", + "minizlib": "^1.3.3", + "mkdirp": "^0.5.5", + "safe-buffer": "^5.2.1", + "yallist": "^3.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } } }, "temp-dir": { @@ -20255,14 +20263,14 @@ "dev": true }, "vue3": { - "version": "npm:vue@3.1.5", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.1.5.tgz", - "integrity": "sha512-Ho7HNb1nfDoO+HVb6qYZgeaobt1XbY6KXFe4HGs1b9X6RhkWG/113n4/SrtM1LUclM6OrP/Se5aPHHvAPG1iVQ==", + "version": "npm:vue@3.2.7", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.2.7.tgz", + "integrity": "sha512-kqPYCbvw6rthEA41K45dqxV+C0yrQX24zs1ZmGZTi4Sk6WkzNK8tH4jGd0yAW+lu72E+HQmz0ZhNo6zAT/WKUA==", "dev": true, "requires": { - "@vue/compiler-dom": "3.1.5", - "@vue/runtime-dom": "3.1.5", - "@vue/shared": "3.1.5" + "@vue/compiler-dom": "3.2.7", + "@vue/runtime-dom": "3.2.7", + "@vue/shared": "3.2.7" } }, "w3c-hr-time": { From 331b65a7b7af11d2b78a7fb8a79969216db85e9a Mon Sep 17 00:00:00 2001 From: Koy Date: Fri, 10 Sep 2021 13:57:38 +0800 Subject: [PATCH 35/60] Create SECURITY.md (#1634) * Create SECURITY.md * Update SECURITY.md Co-authored-by: Joe Pea --- SECURITY.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..1b9f6f908 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,23 @@ +# Security Policy + +If you believe you have found a security vulnerability in docsify, please report it to us asap. + +## Reporting a Vulnerability + +**Please do not report security vulnerabilities through our public GitHub issues.** + +Send email via :email: maintainers@docsifyjs.org to us. + +Please include as much of the following information as possible to help us better understand the possible issue: + +- Type of issue (e.g. cross-site scripting) +- Full paths of source file(s) related to the manifestation of the issue +- The location of the affected source code (tag/branch/commit or direct URL) +- Any special configuration required to reproduce the issue +- Step-by-step instructions to reproduce the issue +- Proof-of-concept or exploit code +- Impact of the issue, including how an attacker might exploit the issue + +This information will help us triage your report more quickly. + +Thank you in advance. From e88c2396e3d967587fc17792be8138138f8b4400 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Wed, 15 Sep 2021 04:42:29 +0200 Subject: [PATCH 36/60] [Snyk] Upgrade dompurify from 2.3.0 to 2.3.1 (#1633) * fix: upgrade dompurify from 2.3.0 to 2.3.1 Snyk has created this PR to upgrade dompurify from 2.3.0 to 2.3.1. See this package in npm: https://www.npmjs.com/package/dompurify See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/836f877b-b98e-47ed-89fc-554e9b2e146d?utm_source=github&utm_medium=upgrade-pr * fix: fix dependency. * fix: fix dependency. * Update package-lock.json * Update package-lock.json Co-authored-by: i544693 <369491420@qq.com> Co-authored-by: Koy --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index aa445aa7d..8fb5273e1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7265,9 +7265,9 @@ } }, "dompurify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.0.tgz", - "integrity": "sha512-VV5C6Kr53YVHGOBKO/F86OYX6/iLTw2yVSI721gKetxpHCK/V5TaLEf9ODjRgl1KLSWRMY6cUhAbv/c+IUnwQw==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.1.tgz", + "integrity": "sha512-xGWt+NHAQS+4tpgbOAI08yxW0Pr256Gu/FNE2frZVTbgrBUn8M7tz7/ktS/LZ2MHeGqz6topj0/xY+y8R5FBFw==" }, "domutils": { "version": "1.7.0", diff --git a/package.json b/package.json index 984f8721d..cc435fde7 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "*.js": "eslint --fix" }, "dependencies": { - "dompurify": "^2.3.0", + "dompurify": "^2.3.1", "marked": "^1.2.9", "medium-zoom": "^1.0.6", "opencollective-postinstall": "^2.0.2", From 5ac8237cc76e19ca2b373a1a1da6eb4a4da6d8b2 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Fri, 17 Sep 2021 08:51:02 +0200 Subject: [PATCH 37/60] fix: upgrade dompurify from 2.3.0 to 2.3.1 (#1635) Snyk has created this PR to upgrade dompurify from 2.3.0 to 2.3.1. See this package in npm: https://www.npmjs.com/package/dompurify See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/6efe7e04-4e52-497e-8ad5-570733cc577a?utm_source=github&utm_medium=upgrade-pr --- packages/docsify-server-renderer/package-lock.json | 6 +++--- packages/docsify-server-renderer/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index 28f0b1a3f..64fa14578 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -28,9 +28,9 @@ } }, "dompurify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.0.tgz", - "integrity": "sha512-VV5C6Kr53YVHGOBKO/F86OYX6/iLTw2yVSI721gKetxpHCK/V5TaLEf9ODjRgl1KLSWRMY6cUhAbv/c+IUnwQw==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.1.tgz", + "integrity": "sha512-xGWt+NHAQS+4tpgbOAI08yxW0Pr256Gu/FNE2frZVTbgrBUn8M7tz7/ktS/LZ2MHeGqz6topj0/xY+y8R5FBFw==" }, "marked": { "version": "1.2.9", diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index 57ddec989..cf2fe2cd9 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -17,7 +17,7 @@ "dependencies": { "debug": "^4.3.2", "docsify": "^4.12.1", - "dompurify": "^2.3.0", + "dompurify": "^2.3.1", "node-fetch": "^2.6.0", "resolve-pathname": "^3.0.0" } From 1dfdacea1ad17b6668648cb337adeefe5aa0f500 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Sep 2021 16:00:12 +0800 Subject: [PATCH 38/60] chore: bump prismjs in /packages/docsify-server-renderer (#1639) Bumps [prismjs](https://github.com/PrismJS/prism) from 1.24.0 to 1.25.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](https://github.com/PrismJS/prism/compare/v1.24.0...v1.25.0) --- updated-dependencies: - dependency-name: prismjs dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/docsify-server-renderer/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index 64fa14578..b19b163b5 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -63,9 +63,9 @@ "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==" }, "prismjs": { - "version": "1.24.0", - "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.0.tgz", - "integrity": "sha512-SqV5GRsNqnzCL8k5dfAjCNhUrF3pR0A9lTDSCUZeh/LIshheXJEaP0hwLz2t4XHivd2J/v2HR+gRnigzeKe3cQ==" + "version": "1.25.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz", + "integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg==" }, "resolve-pathname": { "version": "3.0.0", From 6ee1c142769a6442aa8c1523ab215106707fa7fc Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Sun, 3 Oct 2021 07:11:51 +0200 Subject: [PATCH 39/60] fix: upgrade node-fetch from 2.6.1 to 2.6.2 (#1641) Snyk has created this PR to upgrade node-fetch from 2.6.1 to 2.6.2. See this package in npm: https://www.npmjs.com/package/node-fetch See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/6efe7e04-4e52-497e-8ad5-570733cc577a?utm_source=github&utm_medium=referral&page=upgrade-pr --- packages/docsify-server-renderer/package-lock.json | 6 +++--- packages/docsify-server-renderer/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index b19b163b5..57cd4482c 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -53,9 +53,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==" }, "opencollective-postinstall": { "version": "2.0.3", diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index cf2fe2cd9..87fe7f761 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -18,7 +18,7 @@ "debug": "^4.3.2", "docsify": "^4.12.1", "dompurify": "^2.3.1", - "node-fetch": "^2.6.0", + "node-fetch": "^2.6.2", "resolve-pathname": "^3.0.0" } } From f23f56a945e3c33f5a99d9af2a42fd3a2a8eae82 Mon Sep 17 00:00:00 2001 From: Koy Date: Wed, 6 Oct 2021 13:49:56 +0800 Subject: [PATCH 40/60] docs: update formatUpdated (#1645) * update: docs formatUpdated. --- docs/write-a-plugin.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/write-a-plugin.md b/docs/write-a-plugin.md index 0d605add8..5495a8771 100644 --- a/docs/write-a-plugin.md +++ b/docs/write-a-plugin.md @@ -75,6 +75,8 @@ window.$docsify = { ```js window.$docsify = { + // The date template pattern + formatUpdated: '{YYYY}/{MM}/{DD} {HH}:{mm}', plugins: [ function(hook, vm) { hook.beforeEach(function(html) { From ff6acfa7623a7db8b00d62c51a9c3037215c4888 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Tue, 12 Oct 2021 16:53:17 +0200 Subject: [PATCH 41/60] fix: upgrade dompurify from 2.3.1 to 2.3.2 (#1647) Snyk has created this PR to upgrade dompurify from 2.3.1 to 2.3.2. See this package in npm: https://www.npmjs.com/package/dompurify See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/6efe7e04-4e52-497e-8ad5-570733cc577a?utm_source=github&utm_medium=referral&page=upgrade-pr --- packages/docsify-server-renderer/package-lock.json | 6 +++--- packages/docsify-server-renderer/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index 57cd4482c..bf3027623 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -28,9 +28,9 @@ } }, "dompurify": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.1.tgz", - "integrity": "sha512-xGWt+NHAQS+4tpgbOAI08yxW0Pr256Gu/FNE2frZVTbgrBUn8M7tz7/ktS/LZ2MHeGqz6topj0/xY+y8R5FBFw==" + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.3.2.tgz", + "integrity": "sha512-jXJnvWloI+scD+N5uBikpUMsYXZb0LCAXxLFAOLS5duCzKfXLqBCpuINvFOiI4eJgTLggrngljT18HNoakHUsA==" }, "marked": { "version": "1.2.9", diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index 87fe7f761..43c86d38d 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -17,7 +17,7 @@ "dependencies": { "debug": "^4.3.2", "docsify": "^4.12.1", - "dompurify": "^2.3.1", + "dompurify": "^2.3.2", "node-fetch": "^2.6.2", "resolve-pathname": "^3.0.0" } From 6f81034ba6a7a6b64ccf1acd2d1fc73761f70a63 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Fri, 15 Oct 2021 04:59:10 +0200 Subject: [PATCH 42/60] fix: upgrade node-fetch from 2.6.2 to 2.6.4 (#1649) Snyk has created this PR to upgrade node-fetch from 2.6.2 to 2.6.4. See this package in npm: https://www.npmjs.com/package/node-fetch See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/6efe7e04-4e52-497e-8ad5-570733cc577a?utm_source=github&utm_medium=referral&page=upgrade-pr --- .../docsify-server-renderer/package-lock.json | 28 +++++++++++++++++-- packages/docsify-server-renderer/package.json | 2 +- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index bf3027623..3420b97a4 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -53,9 +53,12 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node-fetch": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", - "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==" + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.4.tgz", + "integrity": "sha512-aD1fO+xtLiSCc9vuD+sYMxpIuQyhHscGSkBEo2o5LTV/3bTEAYvdUii29n8LlO5uLCmWdGP7uVUVXFo5SRdkLA==", + "requires": { + "whatwg-url": "^5.0.0" + } }, "opencollective-postinstall": { "version": "2.0.3", @@ -85,10 +88,29 @@ "resolved": "https://registry.npmjs.org/tinydate/-/tinydate-1.3.0.tgz", "integrity": "sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w==" }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, "tweezer.js": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/tweezer.js/-/tweezer.js-1.5.0.tgz", "integrity": "sha512-aSiJz7rGWNAQq7hjMK9ZYDuEawXupcCWgl3woQQSoDP2Oh8O4srWb/uO1PzzHIsrPEOqrjJ2sUb9FERfzuBabQ==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } } } } diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index 43c86d38d..2f9d5ee67 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -18,7 +18,7 @@ "debug": "^4.3.2", "docsify": "^4.12.1", "dompurify": "^2.3.2", - "node-fetch": "^2.6.2", + "node-fetch": "^2.6.4", "resolve-pathname": "^3.0.0" } } From a5cf85b61dc18171023f06e1366ab5eca903133a Mon Sep 17 00:00:00 2001 From: 2jun0 Date: Fri, 15 Oct 2021 15:11:56 +0900 Subject: [PATCH 43/60] docs: add nameLink for change logo redirect. (#1651) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add nameLink to change logo redirect path for different lang docs. Co-authored-by: 沈唁 <52o@qq52o.cn> --- docs/index.html | 7 +++++++ index.html | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/docs/index.html b/docs/index.html index 7fbd75241..de3ce2663 100644 --- a/docs/index.html +++ b/docs/index.html @@ -95,6 +95,13 @@ id: 6, }, name: 'docsify', + nameLink: { + '/es/': '#/es/', + '/de-de/': '#/de-de/', + '/ru-ru/': '#/ru-ru/', + '/zh-cn/': '#/zh-cn/', + '/': '#/', + }, search: { noData: { '/es/': '¡No hay resultados!', diff --git a/index.html b/index.html index 40758b605..206c1fe3d 100644 --- a/index.html +++ b/index.html @@ -59,6 +59,13 @@ maxLevel: 4, subMaxLevel: 2, name: 'docsify', + nameLink: { + '/es/': '#/es/', + '/de-de/': '#/de-de/', + '/ru-ru/': '#/ru-ru/', + '/zh-cn/': '#/zh-cn/', + '/': '#/', + }, search: { noData: { '/es/': '¡No hay resultados!', From d16e657f708777e8377d8e158b50b4010623282d Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Sun, 17 Oct 2021 04:13:24 +0200 Subject: [PATCH 44/60] fix: upgrade node-fetch from 2.6.4 to 2.6.5 (#1654) Snyk has created this PR to upgrade node-fetch from 2.6.4 to 2.6.5. See this package in npm: https://www.npmjs.com/package/node-fetch See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/6efe7e04-4e52-497e-8ad5-570733cc577a?utm_source=github&utm_medium=referral&page=upgrade-pr --- packages/docsify-server-renderer/package-lock.json | 6 +++--- packages/docsify-server-renderer/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index 3420b97a4..01acbcf1a 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -53,9 +53,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node-fetch": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.4.tgz", - "integrity": "sha512-aD1fO+xtLiSCc9vuD+sYMxpIuQyhHscGSkBEo2o5LTV/3bTEAYvdUii29n8LlO5uLCmWdGP7uVUVXFo5SRdkLA==", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", + "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", "requires": { "whatwg-url": "^5.0.0" } diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index 2f9d5ee67..a615ea84c 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -18,7 +18,7 @@ "debug": "^4.3.2", "docsify": "^4.12.1", "dompurify": "^2.3.2", - "node-fetch": "^2.6.4", + "node-fetch": "^2.6.5", "resolve-pathname": "^3.0.0" } } From 57dc8a923818d8acd4ee59fdbb4aa4499f06feb3 Mon Sep 17 00:00:00 2001 From: 2jun0 Date: Fri, 22 Oct 2021 10:50:34 +0900 Subject: [PATCH 45/60] docs: Update nameLink in configuration.md (#1653) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Like [this commit](https://github.com/docsifyjs/docsify/pull/1651), thie configuration.md page needs to be updated. Co-authored-by: 沈唁 <52o@qq52o.cn> --- docs/configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 96ad8bc9c..689cd395e 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -301,8 +301,8 @@ window.$docsify = { // For each route nameLink: { - '/zh-cn/': '/zh-cn/', - '/': '/', + '/zh-cn/': '#/zh-cn/', + '/': '#/', }, }; ``` From c3cdadc37137edcd9e219359973902d2fc8b66ff Mon Sep 17 00:00:00 2001 From: woshiguabi Date: Fri, 22 Oct 2021 16:01:06 +0800 Subject: [PATCH 46/60] fix: Cannot read property 'tagName' of null (#1655) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Have a look at this issue #1154 . https://codesandbox.io/s/loving-matsumoto-hp985?file=/index.html Open devtools and click the *blank space* of svg(not path) will reproduce this issue. `parentNode` may be `null`. https://github.com/docsifyjs/docsify/blob/develop/src/core/router/history/html5.js#L25-L27 However, hash router has fixed this issue😜. https://github.com/docsifyjs/docsify/blob/develop/src/core/router/history/hash.js#L47-L49 Co-authored-by: 沈唁 <52o@qq52o.cn> --- src/core/router/history/html5.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/router/history/html5.js b/src/core/router/history/html5.js index 28fa2ea27..eeadb1af1 100644 --- a/src/core/router/history/html5.js +++ b/src/core/router/history/html5.js @@ -24,7 +24,7 @@ export class HTML5History extends History { on('click', e => { const el = e.target.tagName === 'A' ? e.target : e.target.parentNode; - if (el.tagName === 'A' && !/_blank/.test(el.target)) { + if (el && el.tagName === 'A' && !/_blank/.test(el.target)) { e.preventDefault(); const url = el.href; // solve history.pushState cross-origin issue From 760e0c79832539d9eb2d891686b22572536a0a4c Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Fri, 19 Nov 2021 01:19:45 -0800 Subject: [PATCH 47/60] docs: update noCompileLinks documentation (#1666) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 沈唁 <52o@qq52o.cn> --- docs/configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 689cd395e..cd45fbe3d 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -508,9 +508,9 @@ window.$docsify = { ## noCompileLinks -- type: `Array` +- type: `Array` -Sometimes we do not want docsify to handle our links. See [#203](https://github.com/docsifyjs/docsify/issues/203) +Sometimes we do not want docsify to handle our links. See [#203](https://github.com/docsifyjs/docsify/issues/203). We can skip compiling of certain links by specifying an array of strings. Each string is converted into to a regular expression (`RegExp`) and the _whole_ href of a link is matched against it. ```js window.$docsify = { From cefe3f87e697a6c54a74d601df2eeb331fcd8933 Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Wed, 24 Nov 2021 08:35:50 +0100 Subject: [PATCH 48/60] fix: upgrade node-fetch from 2.6.5 to 2.6.6 (#1668) Snyk has created this PR to upgrade node-fetch from 2.6.5 to 2.6.6. See this package in npm: https://www.npmjs.com/package/node-fetch See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/6efe7e04-4e52-497e-8ad5-570733cc577a?utm_source=github&utm_medium=referral&page=upgrade-pr --- packages/docsify-server-renderer/package-lock.json | 6 +++--- packages/docsify-server-renderer/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index 01acbcf1a..529ed2bdb 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -53,9 +53,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node-fetch": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz", - "integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==", + "version": "2.6.6", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz", + "integrity": "sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==", "requires": { "whatwg-url": "^5.0.0" } diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index a615ea84c..308b24d9e 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -18,7 +18,7 @@ "debug": "^4.3.2", "docsify": "^4.12.1", "dompurify": "^2.3.2", - "node-fetch": "^2.6.5", + "node-fetch": "^2.6.6", "resolve-pathname": "^3.0.0" } } From f03eb796ad4df3ba1915e564a8103dcef0de8b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9A=96=E9=A3=8E?= <530039987@qq.com> Date: Mon, 6 Dec 2021 10:11:01 +0800 Subject: [PATCH 49/60] fix sidebar height style in Mobile Chrome --- src/themes/basic/_layout.styl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/themes/basic/_layout.styl b/src/themes/basic/_layout.styl index 3d6d5c33b..15b6464fb 100644 --- a/src/themes/basic/_layout.styl +++ b/src/themes/basic/_layout.styl @@ -417,6 +417,7 @@ body.close main height auto + min-height 100vh overflow-x hidden .sidebar From 5e0f68caf04d55e2df3e1605b0162dbf25c71ef4 Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Tue, 7 Dec 2021 16:24:50 -0800 Subject: [PATCH 50/60] convert Docsify and mixins to ES classes --- src/core/Docsify.js | 47 +++-- src/core/config.js | 1 + src/core/event/index.js | 68 +++--- src/core/fetch/index.js | 339 ++++++++++++++--------------- src/core/init/index.js | 27 --- src/core/init/lifecycle.js | 85 ++++---- src/core/render/index.js | 363 ++++++++++++++++---------------- src/core/router/history/hash.js | 3 + src/core/router/index.js | 88 +++++--- test/e2e/sidebar.test.js | 2 +- 10 files changed, 536 insertions(+), 487 deletions(-) delete mode 100644 src/core/init/index.js diff --git a/src/core/Docsify.js b/src/core/Docsify.js index fcb40336b..ba6c54b88 100644 --- a/src/core/Docsify.js +++ b/src/core/Docsify.js @@ -1,21 +1,38 @@ -import { initMixin } from './init'; -import { routerMixin } from './router'; -import { renderMixin } from './render'; -import { fetchMixin } from './fetch'; -import { eventMixin } from './event'; -import initGlobalAPI from './global-api'; +import { Router } from './router/index.js'; +import { Render } from './render/index.js'; +import { Fetch } from './fetch/index.js'; +import { Events } from './event/index.js'; +import initGlobalAPI from './global-api.js'; -export function Docsify() { - this._init(); -} +import config from './config.js'; +import { isFn } from './util/core'; +import { Lifecycle } from './init/lifecycle'; + +/** @typedef {new (...args: any[]) => any} Constructor */ + +// eslint-disable-next-line new-cap +export class Docsify extends Fetch(Events(Render(Router(Lifecycle(Object))))) { + constructor() { + super(); -const proto = Docsify.prototype; + this.config = config(this); -initMixin(proto); -routerMixin(proto); -renderMixin(proto); -fetchMixin(proto); -eventMixin(proto); + this.initLifecycle(); // Init hooks + this.initPlugin(); // Install plugins + this.callHook('init'); + this.initRouter(); // Add router + this.initRender(); // Render base DOM + this.initEvent(); // Bind events + this.initFetch(); // Fetch data + this.callHook('mounted'); + } + + initPlugin() { + [] + .concat(this.config.plugins) + .forEach(fn => isFn(fn) && fn(this._lifecycle, this)); + } +} /** * Global API diff --git a/src/core/config.js b/src/core/config.js index 2d23f5db2..1aa69a796 100644 --- a/src/core/config.js +++ b/src/core/config.js @@ -2,6 +2,7 @@ import { merge, hyphenate, isPrimitive, hasOwn } from './util/core'; const currentScript = document.currentScript; +/** @param {import('./Docsify').Docsify} vm */ export default function(vm) { const config = merge( { diff --git a/src/core/event/index.js b/src/core/event/index.js index 4a312421e..11c02f975 100644 --- a/src/core/event/index.js +++ b/src/core/event/index.js @@ -3,39 +3,47 @@ import { body, on } from '../util/dom'; import * as sidebar from './sidebar'; import { scrollIntoView, scroll2Top } from './scroll'; -export function eventMixin(proto) { - proto.$resetEvents = function(source) { - const { auto2top } = this.config; +/** @typedef {import('../Docsify').Constructor} Constructor */ - (() => { - // Rely on the browser's scroll auto-restoration when going back or forward - if (source === 'history') { - return; - } - // Scroll to ID if specified - if (this.route.query.id) { - scrollIntoView(this.route.path, this.route.query.id); - } - // Scroll to top if a link was clicked and auto2top is enabled - if (source === 'navigate') { - auto2top && scroll2Top(auto2top); +/** + * @template {!Constructor} T + * @param {T} Base - The class to extend + */ +export function Events(Base) { + return class Events extends Base { + $resetEvents(source) { + const { auto2top } = this.config; + + (() => { + // Rely on the browser's scroll auto-restoration when going back or forward + if (source === 'history') { + return; + } + // Scroll to ID if specified + if (this.route.query.id) { + scrollIntoView(this.route.path, this.route.query.id); + } + // Scroll to top if a link was clicked and auto2top is enabled + if (source === 'navigate') { + auto2top && scroll2Top(auto2top); + } + })(); + + if (this.config.loadNavbar) { + sidebar.getAndActive(this.router, 'nav'); } - })(); + } - if (this.config.loadNavbar) { - sidebar.getAndActive(this.router, 'nav'); + initEvent() { + // Bind toggle button + sidebar.btn('button.sidebar-toggle', this.router); + sidebar.collapse('.sidebar', this.router); + // Bind sticky effect + if (this.config.coverpage) { + !isMobile && on('scroll', sidebar.sticky); + } else { + body.classList.add('sticky'); + } } }; } - -export function initEvent(vm) { - // Bind toggle button - sidebar.btn('button.sidebar-toggle', vm.router); - sidebar.collapse('.sidebar', vm.router); - // Bind sticky effect - if (vm.config.coverpage) { - !isMobile && on('scroll', sidebar.sticky); - } else { - body.classList.add('sticky'); - } -} diff --git a/src/core/fetch/index.js b/src/core/fetch/index.js index f0f288798..552ec072e 100644 --- a/src/core/fetch/index.js +++ b/src/core/fetch/index.js @@ -1,5 +1,4 @@ /* eslint-disable no-unused-vars */ -import { callHook } from '../init/lifecycle'; import { getParentPath, stringifyQuery } from '../router/util'; import { noop, isExternal } from '../util/core'; import { getAndActive } from '../event/sidebar'; @@ -20,7 +19,13 @@ function loadNested(path, qs, file, next, vm, first) { ).then(next, _ => loadNested(path, qs, file, next, vm)); } -export function fetchMixin(proto) { +/** @typedef {import('../Docsify').Constructor} Constructor */ + +/** + * @template {!Constructor} T + * @param {T} Base - The class to extend + */ +export function Fetch(Base) { let last; const abort = () => last && last.abort && last.abort(); @@ -59,44 +64,143 @@ export function fetchMixin(proto) { return path404; }; - proto._loadSideAndNav = function(path, qs, loadSidebar, cb) { - return () => { - if (!loadSidebar) { - return cb(); + return class Fetch extends Base { + _loadSideAndNav(path, qs, loadSidebar, cb) { + return () => { + if (!loadSidebar) { + return cb(); + } + + const fn = result => { + this._renderSidebar(result); + cb(); + }; + + // Load sidebar + loadNested(path, qs, loadSidebar, fn, this, true); + }; + } + + _fetch(cb = noop) { + const { query } = this.route; + let { path } = this.route; + + // Prevent loading remote content via URL hash + // Ex: https://foo.com/#//bar.com/file.md + if (isExternal(path)) { + history.replaceState(null, '', '#'); + this.router.normalize(); + } else { + const qs = stringifyQuery(query, ['id']); + const { loadNavbar, requestHeaders, loadSidebar } = this.config; + // Abort last request + + const file = this.router.getFile(path); + const req = request(file + qs, true, requestHeaders); + + this.isRemoteUrl = isExternal(file); + // Current page is html + this.isHTML = /\.html$/g.test(file); + + // Load main content + req.then( + (text, opt) => + this._renderMain( + text, + opt, + this._loadSideAndNav(path, qs, loadSidebar, cb) + ), + _ => { + this._fetchFallbackPage(path, qs, cb) || + this._fetch404(file, qs, cb); + } + ); + + // Load nav + loadNavbar && + loadNested( + path, + qs, + loadNavbar, + text => this._renderNav(text), + this, + true + ); + } + } + + _fetchCover() { + const { coverpage, requestHeaders } = this.config; + const query = this.route.query; + const root = getParentPath(this.route.path); + + if (coverpage) { + let path = null; + const routePath = this.route.path; + if (typeof coverpage === 'string') { + if (routePath === '/') { + path = coverpage; + } + } else if (Array.isArray(coverpage)) { + path = coverpage.indexOf(routePath) > -1 && '_coverpage'; + } else { + const cover = coverpage[routePath]; + path = cover === true ? '_coverpage' : cover; + } + + const coverOnly = Boolean(path) && this.config.onlyCover; + if (path) { + path = this.router.getFile(root + path); + this.coverIsHTML = /\.html$/g.test(path); + get( + path + stringifyQuery(query, ['id']), + false, + requestHeaders + ).then(text => this._renderCover(text, coverOnly)); + } else { + this._renderCover(null, coverOnly); + } + + return coverOnly; } + } - const fn = result => { - this._renderSidebar(result); + $fetch(cb = noop, $resetEvents = this.$resetEvents.bind(this)) { + const done = () => { + this.callHook('doneEach'); cb(); }; - // Load sidebar - loadNested(path, qs, loadSidebar, fn, this, true); - }; - }; + const onlyCover = this._fetchCover(); + + if (onlyCover) { + done(); + } else { + this._fetch(() => { + $resetEvents(); + done(); + }); + } + } + + _fetchFallbackPage(path, qs, cb = noop) { + const { requestHeaders, fallbackLanguages, loadSidebar } = this.config; - proto._fetch = function(cb = noop) { - const { query } = this.route; - let { path } = this.route; + if (!fallbackLanguages) { + return false; + } - // Prevent loading remote content via URL hash - // Ex: https://foo.com/#//bar.com/file.md - if (isExternal(path)) { - history.replaceState(null, '', '#'); - this.router.normalize(); - } else { - const qs = stringifyQuery(query, ['id']); - const { loadNavbar, requestHeaders, loadSidebar } = this.config; - // Abort last request + const local = path.split('/')[1]; - const file = this.router.getFile(path); - const req = request(file + qs, true, requestHeaders); + if (fallbackLanguages.indexOf(local) === -1) { + return false; + } - this.isRemoteUrl = isExternal(file); - // Current page is html - this.isHTML = /\.html$/g.test(file); + const newPath = this.router.getFile( + path.replace(new RegExp(`^/${local}`), '') + ); + const req = request(newPath + qs, true, requestHeaders); - // Load main content req.then( (text, opt) => this._renderMain( @@ -104,154 +208,55 @@ export function fetchMixin(proto) { opt, this._loadSideAndNav(path, qs, loadSidebar, cb) ), - _ => { - this._fetchFallbackPage(path, qs, cb) || this._fetch404(file, qs, cb); - } + () => this._fetch404(path, qs, cb) ); - // Load nav - loadNavbar && - loadNested( - path, - qs, - loadNavbar, - text => this._renderNav(text), - this, - true - ); + return true; } - }; - - proto._fetchCover = function() { - const { coverpage, requestHeaders } = this.config; - const query = this.route.query; - const root = getParentPath(this.route.path); - - if (coverpage) { - let path = null; - const routePath = this.route.path; - if (typeof coverpage === 'string') { - if (routePath === '/') { - path = coverpage; - } - } else if (Array.isArray(coverpage)) { - path = coverpage.indexOf(routePath) > -1 && '_coverpage'; - } else { - const cover = coverpage[routePath]; - path = cover === true ? '_coverpage' : cover; - } - const coverOnly = Boolean(path) && this.config.onlyCover; - if (path) { - path = this.router.getFile(root + path); - this.coverIsHTML = /\.html$/g.test(path); - get( - path + stringifyQuery(query, ['id']), - false, - requestHeaders - ).then(text => this._renderCover(text, coverOnly)); - } else { - this._renderCover(null, coverOnly); + /** + * Load the 404 page + * @param {String} path URL to be loaded + * @param {*} qs TODO: define + * @param {Function} cb Callback + * @returns {Boolean} True if the requested page is not found + * @private + */ + _fetch404(path, qs, cb = noop) { + const { loadSidebar, requestHeaders, notFoundPage } = this.config; + + const fnLoadSideAndNav = this._loadSideAndNav(path, qs, loadSidebar, cb); + if (notFoundPage) { + const path404 = get404Path(path, this.config); + + request(this.router.getFile(path404), true, requestHeaders).then( + (text, opt) => this._renderMain(text, opt, fnLoadSideAndNav), + () => this._renderMain(null, {}, fnLoadSideAndNav) + ); + return true; } - return coverOnly; - } - }; - - proto.$fetch = function( - cb = noop, - $resetEvents = this.$resetEvents.bind(this) - ) { - const done = () => { - callHook(this, 'doneEach'); - cb(); - }; - - const onlyCover = this._fetchCover(); - - if (onlyCover) { - done(); - } else { - this._fetch(() => { - $resetEvents(); - done(); - }); - } - }; - - proto._fetchFallbackPage = function(path, qs, cb = noop) { - const { requestHeaders, fallbackLanguages, loadSidebar } = this.config; - - if (!fallbackLanguages) { + this._renderMain(null, {}, fnLoadSideAndNav); return false; } - const local = path.split('/')[1]; + initFetch() { + const { loadSidebar } = this.config; - if (fallbackLanguages.indexOf(local) === -1) { - return false; - } - - const newPath = this.router.getFile( - path.replace(new RegExp(`^/${local}`), '') - ); - const req = request(newPath + qs, true, requestHeaders); - - req.then( - (text, opt) => - this._renderMain( - text, - opt, - this._loadSideAndNav(path, qs, loadSidebar, cb) - ), - () => this._fetch404(path, qs, cb) - ); - - return true; - }; + // Server-Side Rendering + if (this.rendered) { + const activeEl = getAndActive(this.router, '.sidebar-nav', true, true); + if (loadSidebar && activeEl) { + activeEl.parentNode.innerHTML += window.__SUB_SIDEBAR__; + } - /** - * Load the 404 page - * @param {String} path URL to be loaded - * @param {*} qs TODO: define - * @param {Function} cb Callback - * @returns {Boolean} True if the requested page is not found - * @private - */ - proto._fetch404 = function(path, qs, cb = noop) { - const { loadSidebar, requestHeaders, notFoundPage } = this.config; - - const fnLoadSideAndNav = this._loadSideAndNav(path, qs, loadSidebar, cb); - if (notFoundPage) { - const path404 = get404Path(path, this.config); - - request(this.router.getFile(path404), true, requestHeaders).then( - (text, opt) => this._renderMain(text, opt, fnLoadSideAndNav), - () => this._renderMain(null, {}, fnLoadSideAndNav) - ); - return true; + this._bindEventOnRendered(activeEl); + this.$resetEvents(); + this.callHook('doneEach'); + this.callHook('ready'); + } else { + this.$fetch(_ => this.callHook('ready')); + } } - - this._renderMain(null, {}, fnLoadSideAndNav); - return false; }; } - -export function initFetch(vm) { - const { loadSidebar } = vm.config; - - // Server-Side Rendering - if (vm.rendered) { - const activeEl = getAndActive(vm.router, '.sidebar-nav', true, true); - if (loadSidebar && activeEl) { - activeEl.parentNode.innerHTML += window.__SUB_SIDEBAR__; - } - - vm._bindEventOnRendered(activeEl); - vm.$resetEvents(); - callHook(vm, 'doneEach'); - callHook(vm, 'ready'); - } else { - vm.$fetch(_ => callHook(vm, 'ready')); - } -} diff --git a/src/core/init/index.js b/src/core/init/index.js deleted file mode 100644 index 255aad06c..000000000 --- a/src/core/init/index.js +++ /dev/null @@ -1,27 +0,0 @@ -import config from '../config'; -import { initRender } from '../render'; -import { initRouter } from '../router'; -import { initEvent } from '../event'; -import { initFetch } from '../fetch'; -import { isFn } from '../util/core'; -import { initLifecycle, callHook } from './lifecycle'; - -export function initMixin(proto) { - proto._init = function() { - const vm = this; - vm.config = config(vm); - - initLifecycle(vm); // Init hooks - initPlugin(vm); // Install plugins - callHook(vm, 'init'); - initRouter(vm); // Add router - initRender(vm); // Render base DOM - initEvent(vm); // Bind events - initFetch(vm); // Fetch data - callHook(vm, 'mounted'); - }; -} - -function initPlugin(vm) { - [].concat(vm.config.plugins).forEach(fn => isFn(fn) && fn(vm._lifecycle, vm)); -} diff --git a/src/core/init/lifecycle.js b/src/core/init/lifecycle.js index d695ed6e6..38c0dd785 100644 --- a/src/core/init/lifecycle.js +++ b/src/core/init/lifecycle.js @@ -1,46 +1,57 @@ import { noop } from '../util/core'; -export function initLifecycle(vm) { - const hooks = [ - 'init', - 'mounted', - 'beforeEach', - 'afterEach', - 'doneEach', - 'ready', - ]; - - vm._hooks = {}; - vm._lifecycle = {}; - hooks.forEach(hook => { - const arr = (vm._hooks[hook] = []); - vm._lifecycle[hook] = fn => arr.push(fn); - }); -} +/** @typedef {import('../Docsify').Constructor} Constructor */ + +/** + * @template {!Constructor} T + * @param {T} Base - The class to extend + */ +export function Lifecycle(Base) { + return class Lifecycle extends Base { + initLifecycle() { + const hooks = [ + 'init', + 'mounted', + 'beforeEach', + 'afterEach', + 'doneEach', + 'ready', + ]; -export function callHook(vm, hookName, data, next = noop) { - const queue = vm._hooks[hookName]; + this._hooks = {}; + this._lifecycle = {}; + + hooks.forEach(hook => { + const arr = (this._hooks[hook] = []); + this._lifecycle[hook] = fn => arr.push(fn); + }); + } - const step = function(index) { - const hookFn = queue[index]; + callHook(hookName, data, next = noop) { + const queue = this._hooks[hookName]; - if (index >= queue.length) { - next(data); - } else if (typeof hookFn === 'function') { - if (hookFn.length === 2) { - hookFn(data, result => { - data = result; + const step = function(index) { + const hookFn = queue[index]; + + if (index >= queue.length) { + next(data); + } else if (typeof hookFn === 'function') { + if (hookFn.length === 2) { + hookFn(data, result => { + data = result; + step(index + 1); + }); + } else { + const result = hookFn(data); + data = result === undefined ? data : result; + step(index + 1); + } + } else { step(index + 1); - }); - } else { - const result = hookFn(data); - data = result === undefined ? data : result; - step(index + 1); - } - } else { - step(index + 1); + } + }; + + step(0); } }; - - step(0); } diff --git a/src/core/render/index.js b/src/core/render/index.js index 9fb777baf..d0e6c4626 100644 --- a/src/core/render/index.js +++ b/src/core/render/index.js @@ -3,7 +3,6 @@ import tinydate from 'tinydate'; import DOMPurify from 'dompurify'; import * as dom from '../util/dom'; import cssVars from '../util/polyfill/css-vars'; -import { callHook } from '../init/lifecycle'; import { getAndActive, sticky } from '../event/sidebar'; import { getPath, isAbsolutePath } from '../router/util'; import { isMobile, inBrowser } from '../util/env'; @@ -239,223 +238,235 @@ function renderNameLink(vm) { } } -export function renderMixin(proto) { - proto._renderTo = function(el, content, replace) { - const node = dom.getNode(el); - if (node) { - node[replace ? 'outerHTML' : 'innerHTML'] = content; +/** @typedef {import('../Docsify').Constructor} Constructor */ + +/** + * @template {!Constructor} T + * @param {T} Base - The class to extend + */ +export function Render(Base) { + return class Render extends Base { + _renderTo(el, content, replace) { + const node = dom.getNode(el); + if (node) { + node[replace ? 'outerHTML' : 'innerHTML'] = content; + } } - }; - proto._renderSidebar = function(text) { - const { maxLevel, subMaxLevel, loadSidebar, hideSidebar } = this.config; - - if (hideSidebar) { - // FIXME : better styling solution - [ - document.querySelector('aside.sidebar'), - document.querySelector('button.sidebar-toggle'), - ].forEach(node => node.parentNode.removeChild(node)); - document.querySelector('section.content').style.right = 'unset'; - document.querySelector('section.content').style.left = 'unset'; - document.querySelector('section.content').style.position = 'relative'; - document.querySelector('section.content').style.width = '100%'; - return null; - } + _renderSidebar(text) { + const { maxLevel, subMaxLevel, loadSidebar, hideSidebar } = this.config; + + if (hideSidebar) { + // FIXME : better styling solution + [ + document.querySelector('aside.sidebar'), + document.querySelector('button.sidebar-toggle'), + ].forEach(node => node.parentNode.removeChild(node)); + document.querySelector('section.content').style.right = 'unset'; + document.querySelector('section.content').style.left = 'unset'; + document.querySelector('section.content').style.position = 'relative'; + document.querySelector('section.content').style.width = '100%'; + return null; + } - this._renderTo('.sidebar-nav', this.compiler.sidebar(text, maxLevel)); - const activeEl = getAndActive(this.router, '.sidebar-nav', true, true); - if (loadSidebar && activeEl) { - activeEl.parentNode.innerHTML += - this.compiler.subSidebar(subMaxLevel) || ''; - } else { - // Reset toc - this.compiler.subSidebar(); - } + this._renderTo('.sidebar-nav', this.compiler.sidebar(text, maxLevel)); + const activeEl = getAndActive(this.router, '.sidebar-nav', true, true); + if (loadSidebar && activeEl) { + activeEl.parentNode.innerHTML += + this.compiler.subSidebar(subMaxLevel) || ''; + } else { + // Reset toc + this.compiler.subSidebar(); + } - // Bind event - this._bindEventOnRendered(activeEl); - }; + // Bind event + this._bindEventOnRendered(activeEl); + } - proto._bindEventOnRendered = function(activeEl) { - const { autoHeader } = this.config; + _bindEventOnRendered(activeEl) { + const { autoHeader } = this.config; - scrollActiveSidebar(this.router); + scrollActiveSidebar(this.router); - if (autoHeader && activeEl) { - const main = dom.getNode('#main'); - const firstNode = main.children[0]; - if (firstNode && firstNode.tagName !== 'H1') { - const h1 = this.compiler.header(activeEl.innerText, 1); - const wrapper = dom.create('div', h1); - dom.before(main, wrapper.children[0]); + if (autoHeader && activeEl) { + const main = dom.getNode('#main'); + const firstNode = main.children[0]; + if (firstNode && firstNode.tagName !== 'H1') { + const h1 = this.compiler.header(activeEl.innerText, 1); + const wrapper = dom.create('div', h1); + dom.before(main, wrapper.children[0]); + } } } - }; - proto._renderNav = function(text) { - text && this._renderTo('nav', this.compiler.compile(text)); - if (this.config.loadNavbar) { - getAndActive(this.router, 'nav'); + _renderNav(text) { + text && this._renderTo('nav', this.compiler.compile(text)); + if (this.config.loadNavbar) { + getAndActive(this.router, 'nav'); + } } - }; - proto._renderMain = function(text, opt = {}, next) { - if (!text) { - return renderMain.call(this, text); - } + _renderMain(text, opt = {}, next) { + if (!text) { + return renderMain.call(this, text); + } - callHook(this, 'beforeEach', text, result => { - let html; - const callback = () => { - if (opt.updatedAt) { - html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated); + this.callHook('beforeEach', text, result => { + let html; + const callback = () => { + if (opt.updatedAt) { + html = formatUpdated( + html, + opt.updatedAt, + this.config.formatUpdated + ); + } + + this.callHook('afterEach', html, hookData => + renderMain.call(this, hookData) + ); + }; + + if (this.isHTML) { + html = this.result = text; + callback(); + next(); + } else { + prerenderEmbed( + { + compiler: this.compiler, + raw: result, + }, + tokens => { + html = this.compiler.compile(tokens); + html = this.isRemoteUrl + ? DOMPurify.sanitize(html, { ADD_TAGS: ['script'] }) + : html; + callback(); + next(); + } + ); } + }); + } - callHook(this, 'afterEach', html, hookData => - renderMain.call(this, hookData) - ); - }; + _renderCover(text, coverOnly) { + const el = dom.getNode('.cover'); - if (this.isHTML) { - html = this.result = text; - callback(); - next(); - } else { - prerenderEmbed( - { - compiler: this.compiler, - raw: result, - }, - tokens => { - html = this.compiler.compile(tokens); - html = this.isRemoteUrl - ? DOMPurify.sanitize(html, { ADD_TAGS: ['script'] }) - : html; - callback(); - next(); - } - ); + dom.toggleClass( + dom.getNode('main'), + coverOnly ? 'add' : 'remove', + 'hidden' + ); + if (!text) { + dom.toggleClass(el, 'remove', 'show'); + return; } - }); - }; - proto._renderCover = function(text, coverOnly) { - const el = dom.getNode('.cover'); + dom.toggleClass(el, 'add', 'show'); - dom.toggleClass( - dom.getNode('main'), - coverOnly ? 'add' : 'remove', - 'hidden' - ); - if (!text) { - dom.toggleClass(el, 'remove', 'show'); - return; - } - - dom.toggleClass(el, 'add', 'show'); + let html = this.coverIsHTML ? text : this.compiler.cover(text); - let html = this.coverIsHTML ? text : this.compiler.cover(text); + const m = html + .trim() + .match('

([^<]*?)

$'); - const m = html - .trim() - .match('

([^<]*?)

$'); + if (m) { + if (m[2] === 'color') { + el.style.background = m[1] + (m[3] || ''); + } else { + let path = m[1]; - if (m) { - if (m[2] === 'color') { - el.style.background = m[1] + (m[3] || ''); - } else { - let path = m[1]; + dom.toggleClass(el, 'add', 'has-mask'); + if (!isAbsolutePath(m[1])) { + path = getPath(this.router.getBasePath(), m[1]); + } - dom.toggleClass(el, 'add', 'has-mask'); - if (!isAbsolutePath(m[1])) { - path = getPath(this.router.getBasePath(), m[1]); + el.style.backgroundImage = `url(${path})`; + el.style.backgroundSize = 'cover'; + el.style.backgroundPosition = 'center center'; } - el.style.backgroundImage = `url(${path})`; - el.style.backgroundSize = 'cover'; - el.style.backgroundPosition = 'center center'; + html = html.replace(m[0], ''); } - html = html.replace(m[0], ''); + this._renderTo('.cover-main', html); + sticky(); } - this._renderTo('.cover-main', html); - sticky(); - }; + _updateRender() { + // Render name link + renderNameLink(this); + } - proto._updateRender = function() { - // Render name link - renderNameLink(this); - }; -} + initRender() { + const config = this.config; -export function initRender(vm) { - const config = vm.config; + // Init markdown compiler + this.compiler = new Compiler(config, this.router); + if (inBrowser) { + /* eslint-disable-next-line camelcase */ + window.__current_docsify_compiler__ = this.compiler; + } - // Init markdown compiler - vm.compiler = new Compiler(config, vm.router); - if (inBrowser) { - /* eslint-disable-next-line camelcase */ - window.__current_docsify_compiler__ = vm.compiler; - } + const id = config.el || '#app'; + const navEl = dom.find('nav') || dom.create('nav'); - const id = config.el || '#app'; - const navEl = dom.find('nav') || dom.create('nav'); + const el = dom.find(id); + let html = ''; + let navAppendToTarget = dom.body; - const el = dom.find(id); - let html = ''; - let navAppendToTarget = dom.body; + if (el) { + if (config.repo) { + html += tpl.corner(config.repo, config.cornerExternalLinkTarge); + } - if (el) { - if (config.repo) { - html += tpl.corner(config.repo, config.cornerExternalLinkTarge); - } + if (config.coverpage) { + html += tpl.cover(); + } - if (config.coverpage) { - html += tpl.cover(); - } + if (config.logo) { + const isBase64 = /^data:image/.test(config.logo); + const isExternal = /(?:http[s]?:)?\/\//.test(config.logo); + const isRelative = /^\./.test(config.logo); - if (config.logo) { - const isBase64 = /^data:image/.test(config.logo); - const isExternal = /(?:http[s]?:)?\/\//.test(config.logo); - const isRelative = /^\./.test(config.logo); + if (!isBase64 && !isExternal && !isRelative) { + config.logo = getPath(this.router.getBasePath(), config.logo); + } + } - if (!isBase64 && !isExternal && !isRelative) { - config.logo = getPath(vm.router.getBasePath(), config.logo); + html += tpl.main(config); + // Render main app + this._renderTo(el, html, true); + } else { + this.rendered = true; } - } - html += tpl.main(config); - // Render main app - vm._renderTo(el, html, true); - } else { - vm.rendered = true; - } - - if (config.mergeNavbar && isMobile) { - navAppendToTarget = dom.find('.sidebar'); - } else { - navEl.classList.add('app-nav'); + if (config.mergeNavbar && isMobile) { + navAppendToTarget = dom.find('.sidebar'); + } else { + navEl.classList.add('app-nav'); - if (!config.repo) { - navEl.classList.add('no-badge'); - } - } + if (!config.repo) { + navEl.classList.add('no-badge'); + } + } - // Add nav - if (config.loadNavbar) { - dom.before(navAppendToTarget, navEl); - } + // Add nav + if (config.loadNavbar) { + dom.before(navAppendToTarget, navEl); + } - if (config.themeColor) { - dom.$.head.appendChild( - dom.create('div', tpl.theme(config.themeColor)).firstElementChild - ); - // Polyfll - cssVars(config.themeColor); - } + if (config.themeColor) { + dom.$.head.appendChild( + dom.create('div', tpl.theme(config.themeColor)).firstElementChild + ); + // Polyfll + cssVars(config.themeColor); + } - vm._updateRender(); - dom.toggleClass(dom.body, 'ready'); + this._updateRender(); + dom.toggleClass(dom.body, 'ready'); + } + }; } diff --git a/src/core/router/history/hash.js b/src/core/router/history/hash.js index a2a52aee4..cf948683b 100644 --- a/src/core/router/history/hash.js +++ b/src/core/router/history/hash.js @@ -36,6 +36,7 @@ export class HashHistory extends History { return index === -1 ? '' : href.slice(index + 1); } + /** @param {((params: {source: TODO}) => void)} [cb] */ onchange(cb = noop) { // The hashchange event does not tell us if it originated from // a clicked link or by moving back/forward in the history; @@ -100,3 +101,5 @@ export class HashHistory extends History { return '#' + super.toURL(path, params, currentRoute); } } + +/** @typedef {any} TODO */ diff --git a/src/core/router/index.js b/src/core/router/index.js index 923168898..6bbd395b8 100644 --- a/src/core/router/index.js +++ b/src/core/router/index.js @@ -4,44 +4,64 @@ import { noop } from '../util/core'; import { HashHistory } from './history/hash'; import { HTML5History } from './history/html5'; -export function routerMixin(proto) { - proto.route = {}; -} +/** + * @typedef {{ + * path?: string + * }} Route + */ +/** @type {Route} */ let lastRoute = {}; -function updateRender(vm) { - vm.router.normalize(); - vm.route = vm.router.parse(); - dom.body.setAttribute('data-page', vm.route.file); -} +/** @typedef {import('../Docsify').Constructor} Constructor */ + +/** + * @template {!Constructor} T + * @param {T} Base - The class to extend + */ +export function Router(Base) { + return class Router extends Base { + /** @param {any[]} args */ + constructor(...args) { + super(...args); -export function initRouter(vm) { - const config = vm.config; - const mode = config.routerMode || 'hash'; - let router; - - if (mode === 'history' && supportsPushState) { - router = new HTML5History(config); - } else { - router = new HashHistory(config); - } - - vm.router = router; - updateRender(vm); - lastRoute = vm.route; - - // eslint-disable-next-line no-unused-vars - router.onchange(params => { - updateRender(vm); - vm._updateRender(); - - if (lastRoute.path === vm.route.path) { - vm.$resetEvents(params.source); - return; + this.route = {}; } - vm.$fetch(noop, vm.$resetEvents.bind(vm, params.source)); - lastRoute = vm.route; - }); + updateRender() { + this.router.normalize(); + this.route = this.router.parse(); + dom.body.setAttribute('data-page', this.route.file); + } + + initRouter() { + const config = this.config; + const mode = config.routerMode || 'hash'; + let router; + + if (mode === 'history' && supportsPushState) { + router = new HTML5History(config); + } else { + router = new HashHistory(config); + } + + this.router = router; + this.updateRender(); + lastRoute = this.route; + + // eslint-disable-next-line no-unused-vars + router.onchange(params => { + this.updateRender(); + this._updateRender(); + + if (lastRoute.path === this.route.path) { + this.$resetEvents(params.source); + return; + } + + this.$fetch(noop, this.$resetEvents.bind(this, params.source)); + lastRoute = this.route; + }); + } + }; } diff --git a/test/e2e/sidebar.test.js b/test/e2e/sidebar.test.js index d289d1cbc..aba338c74 100644 --- a/test/e2e/sidebar.test.js +++ b/test/e2e/sidebar.test.js @@ -56,8 +56,8 @@ describe('Sidebar Tests', function() { expect(page.url()).toMatch(/\/test-foo$/); await page.click('a[href="#/test.foo"]'); - await expect(page).toEqualText('.sidebar-nav li[class=active]', 'Test .'); expect(page.url()).toMatch(/\/test.foo$/); + await expect(page).toEqualText('.sidebar-nav li[class=active]', 'Test .'); await page.click('a[href="#/test>foo"]'); await expect(page).toEqualText('.sidebar-nav li[class=active]', 'Test >'); From 1a836c9479928496d6577ba32e24165eaa25cdea Mon Sep 17 00:00:00 2001 From: i544693 <369491420@qq.com> Date: Fri, 10 Dec 2021 01:55:30 +0800 Subject: [PATCH 51/60] test:docker locally. --- Dockerfile | 9 +++++++++ package.json | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..b07a97ce3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM mcr.microsoft.com/playwright:focal +WORKDIR /app +COPY . . +RUN rm package-lock.json +RUN npm install +RUN npx playwright install +RUN npm run build +ENTRYPOINT ["npm", "run"] +CMD ["test"] \ No newline at end of file diff --git a/package.json b/package.json index cc435fde7..ba513ce94 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,13 @@ "prepare": "npm run build", "pub:next": "cross-env RELEASE_TAG=next sh build/release.sh", "pub": "sh build/release.sh", - "postinstall": "opencollective-postinstall" + "postinstall": "opencollective-postinstall", + "docker:build": "docker build -f Dockerfile -t docsify-test:local .", + "docker:clean": "docker rmi docsify-test:local", + "docker:test": "docker run --rm -it --ipc=host --user pwuser docsify-test:local test", + "docker:test:e2e": "docker run --rm -it --ipc=host --user pwuser docsify-test:local test:e2e", + "docker:test:integration": "docker run --rm -it --ipc=host --user pwuser ddocsify-test:local test:integration", + "docker:test:unit": "docker run --rm -it --ipc=host --user pwuser docsify-test:local test:unit" }, "husky": { "hooks": { From 9200174666b000885da610759eb684f218ed024f Mon Sep 17 00:00:00 2001 From: i544693 <369491420@qq.com> Date: Fri, 10 Dec 2021 02:09:19 +0800 Subject: [PATCH 52/60] update: remove user. --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ba513ce94..6a01ebcc6 100644 --- a/package.json +++ b/package.json @@ -46,10 +46,10 @@ "postinstall": "opencollective-postinstall", "docker:build": "docker build -f Dockerfile -t docsify-test:local .", "docker:clean": "docker rmi docsify-test:local", - "docker:test": "docker run --rm -it --ipc=host --user pwuser docsify-test:local test", - "docker:test:e2e": "docker run --rm -it --ipc=host --user pwuser docsify-test:local test:e2e", - "docker:test:integration": "docker run --rm -it --ipc=host --user pwuser ddocsify-test:local test:integration", - "docker:test:unit": "docker run --rm -it --ipc=host --user pwuser docsify-test:local test:unit" + "docker:test": "docker run --rm -it --ipc=host docsify-test:local test", + "docker:test:e2e": "docker run --rm -it --ipc=host docsify-test:local test:e2e", + "docker:test:integration": "docker run --rm -it --ipc=host ddocsify-test:local test:integration", + "docker:test:unit": "docker run --rm -it --ipc=host docsify-test:local test:unit" }, "husky": { "hooks": { From ba2127bcfa877ec7c82377440fbf578d3e577455 Mon Sep 17 00:00:00 2001 From: i544693 <369491420@qq.com> Date: Fri, 10 Dec 2021 02:11:12 +0800 Subject: [PATCH 53/60] update: rebuild. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 6a01ebcc6..17abecefc 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "postinstall": "opencollective-postinstall", "docker:build": "docker build -f Dockerfile -t docsify-test:local .", "docker:clean": "docker rmi docsify-test:local", + "docker:rebuild": "npm run docker:clean && npm run docker:build", "docker:test": "docker run --rm -it --ipc=host docsify-test:local test", "docker:test:e2e": "docker run --rm -it --ipc=host docsify-test:local test:e2e", "docker:test:integration": "docker run --rm -it --ipc=host ddocsify-test:local test:integration", From a5b34c2c3fcd50e9bd59597de7e1bbff17a724b7 Mon Sep 17 00:00:00 2001 From: i544693 <369491420@qq.com> Date: Fri, 10 Dec 2021 02:12:58 +0800 Subject: [PATCH 54/60] update: integration. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 17abecefc..80173de06 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "docker:rebuild": "npm run docker:clean && npm run docker:build", "docker:test": "docker run --rm -it --ipc=host docsify-test:local test", "docker:test:e2e": "docker run --rm -it --ipc=host docsify-test:local test:e2e", - "docker:test:integration": "docker run --rm -it --ipc=host ddocsify-test:local test:integration", + "docker:test:integration": "docker run --rm -it --ipc=host docsify-test:local test:integration", "docker:test:unit": "docker run --rm -it --ipc=host docsify-test:local test:unit" }, "husky": { From c4543359187a278feaeab8829941257e0b6595c5 Mon Sep 17 00:00:00 2001 From: i544693 <369491420@qq.com> Date: Fri, 10 Dec 2021 16:41:41 +0800 Subject: [PATCH 55/60] update: commands. --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 80173de06..fcdec3c52 100644 --- a/package.json +++ b/package.json @@ -47,10 +47,10 @@ "docker:build": "docker build -f Dockerfile -t docsify-test:local .", "docker:clean": "docker rmi docsify-test:local", "docker:rebuild": "npm run docker:clean && npm run docker:build", - "docker:test": "docker run --rm -it --ipc=host docsify-test:local test", - "docker:test:e2e": "docker run --rm -it --ipc=host docsify-test:local test:e2e", - "docker:test:integration": "docker run --rm -it --ipc=host docsify-test:local test:integration", - "docker:test:unit": "docker run --rm -it --ipc=host docsify-test:local test:unit" + "docker:test": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test", + "docker:test:e2e": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:e2e", + "docker:test:integration": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:integration", + "docker:test:unit": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:unit" }, "husky": { "hooks": { From 40e77490c68b4143c75dfaebcd0b7f640581306b Mon Sep 17 00:00:00 2001 From: Snyk bot Date: Tue, 21 Dec 2021 07:29:04 +0000 Subject: [PATCH 56/60] fix: upgrade debug from 4.3.2 to 4.3.3 (#1692) Snyk has created this PR to upgrade debug from 4.3.2 to 4.3.3. See this package in npm: https://www.npmjs.com/package/debug See this project in Snyk: https://app.snyk.io/org/anikethsaha/project/6efe7e04-4e52-497e-8ad5-570733cc577a?utm_source=github&utm_medium=referral&page=upgrade-pr --- packages/docsify-server-renderer/package-lock.json | 6 +++--- packages/docsify-server-renderer/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index 529ed2bdb..e42c40602 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "requires": { "ms": "2.1.2" } diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index 308b24d9e..a41329a05 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -15,7 +15,7 @@ "test": "echo 'hello'" }, "dependencies": { - "debug": "^4.3.2", + "debug": "^4.3.3", "docsify": "^4.12.1", "dompurify": "^2.3.2", "node-fetch": "^2.6.6", From c90c6a4b7481ac53ab2c29d62160ef9af66de483 Mon Sep 17 00:00:00 2001 From: Joe Pea Date: Mon, 3 Jan 2022 23:54:37 -0800 Subject: [PATCH 57/60] style: allow devs to test both build and tests at the same time (#1707) The docker:rebuild script rebuilds the docker image from scratch including the Docsify build, while the new one rebuilds only Docsify code and makes local re-testing faster. --- package.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index fcdec3c52..338e4aa95 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "lint": "eslint .", "fixlint": "eslint . --fix", "test": "jest", + "build:test": "npm run build && npm test", "test:e2e": "jest --selectProjects e2e", "test:integration": "jest --selectProjects integration", "test:unit": "jest --selectProjects unit", @@ -47,10 +48,12 @@ "docker:build": "docker build -f Dockerfile -t docsify-test:local .", "docker:clean": "docker rmi docsify-test:local", "docker:rebuild": "npm run docker:clean && npm run docker:build", - "docker:test": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test", - "docker:test:e2e": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:e2e", - "docker:test:integration": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:integration", - "docker:test:unit": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local test:unit" + "docker:test": "npm run docker:cli -- test", + "docker:build:test": "npm run docker:cli -- build:test", + "docker:test:e2e": "npm run docker:cli -- test:e2e", + "docker:test:integration": "npm run docker:cli -- test:integration", + "docker:test:unit": "npm run docker:cli -- test:unit", + "docker:cli": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local" }, "husky": { "hooks": { From e405120e087255e163c6fef256fb7519dd7e2b94 Mon Sep 17 00:00:00 2001 From: i544693 <369491420@qq.com> Date: Thu, 6 Jan 2022 16:55:22 +0800 Subject: [PATCH 58/60] [build] 4.12.2 --- docs/_coverpage.md | 2 +- packages/docsify-server-renderer/package-lock.json | 2 +- packages/docsify-server-renderer/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_coverpage.md b/docs/_coverpage.md index 67370c552..bd0fe2965 100644 --- a/docs/_coverpage.md +++ b/docs/_coverpage.md @@ -1,6 +1,6 @@ ![logo](_media/icon.svg) -# docsify 4.12.1 +# docsify 4.12.2 > A magical documentation site generator. diff --git a/packages/docsify-server-renderer/package-lock.json b/packages/docsify-server-renderer/package-lock.json index e42c40602..be4201221 100644 --- a/packages/docsify-server-renderer/package-lock.json +++ b/packages/docsify-server-renderer/package-lock.json @@ -1,6 +1,6 @@ { "name": "docsify-server-renderer", - "version": "4.12.1", + "version": "4.12.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/docsify-server-renderer/package.json b/packages/docsify-server-renderer/package.json index a41329a05..54972cbac 100644 --- a/packages/docsify-server-renderer/package.json +++ b/packages/docsify-server-renderer/package.json @@ -1,6 +1,6 @@ { "name": "docsify-server-renderer", - "version": "4.12.1", + "version": "4.12.2", "description": "docsify server renderer", "author": { "name": "qingwei-li", From e80238d4fca46b061a97c27744c9595c60ecc05c Mon Sep 17 00:00:00 2001 From: i544693 <369491420@qq.com> Date: Thu, 6 Jan 2022 16:55:27 +0800 Subject: [PATCH 59/60] chore: add changelog 4.12.2 --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8322aa7eb..95e3f3746 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,30 @@ +## [4.12.2](https://github.com/docsifyjs/docsify/compare/v4.12.1...v4.12.2) (2022-01-06) + + +### Bug Fixes + +* Add escapeHtml for search ([#1551](https://github.com/docsifyjs/docsify/issues/1551)) ([c24f7f6](https://github.com/docsifyjs/docsify/commit/c24f7f6f0b87a87f6dd3755f69eb0969ebb029c9)) +* allow also " inside of an embed ([ec16e4a](https://github.com/docsifyjs/docsify/commit/ec16e4a9d5718ac4f4c25bb3dcaea3b7551372e0)) +* buble theme missing generic fallback font ([#1568](https://github.com/docsifyjs/docsify/issues/1568)) ([37d9f0e](https://github.com/docsifyjs/docsify/commit/37d9f0e1214276e93b2a11ed87390aafa1bdbcec)) +* Cannot read property 'classList' of null ([#1527](https://github.com/docsifyjs/docsify/issues/1527)) ([d6df2b8](https://github.com/docsifyjs/docsify/commit/d6df2b85a99371bb9a87402a10dd515bb734182e)), closes [/github.com/docsifyjs/docsify/pull/1527#issuecomment-793455105](https://github.com//github.com/docsifyjs/docsify/pull/1527/issues/issuecomment-793455105) +* Cannot read property 'tagName' of null ([#1655](https://github.com/docsifyjs/docsify/issues/1655)) ([c3cdadc](https://github.com/docsifyjs/docsify/commit/c3cdadc37137edcd9e219359973902d2fc8b66ff)), closes [#1154](https://github.com/docsifyjs/docsify/issues/1154) [/github.com/docsifyjs/docsify/blob/develop/src/core/router/history/html5.js#L25-L27](https://github.com//github.com/docsifyjs/docsify/blob/develop/src/core/router/history/html5.js/issues/L25-L27) [/github.com/docsifyjs/docsify/blob/develop/src/core/router/history/hash.js#L47-L49](https://github.com//github.com/docsifyjs/docsify/blob/develop/src/core/router/history/hash.js/issues/L47-L49) +* upgrade debug from 4.3.2 to 4.3.3 ([#1692](https://github.com/docsifyjs/docsify/issues/1692)) ([40e7749](https://github.com/docsifyjs/docsify/commit/40e77490c68b4143c75dfaebcd0b7f640581306b)) +* Upgrade docsify from 4.12.0 to 4.12.1 ([#1544](https://github.com/docsifyjs/docsify/issues/1544)) ([d607f6d](https://github.com/docsifyjs/docsify/commit/d607f6d71c35b50f586806a832f65061f5e3427e)) +* upgrade dompurify from 2.2.6 to 2.2.7 ([#1552](https://github.com/docsifyjs/docsify/issues/1552)) ([407e4d4](https://github.com/docsifyjs/docsify/commit/407e4d4f3de78bebd639a3fdae751f8045728e57)) +* Upgrade dompurify from 2.2.6 to 2.2.7 ([#1553](https://github.com/docsifyjs/docsify/issues/1553)) ([93c48f3](https://github.com/docsifyjs/docsify/commit/93c48f3d615d95dba550a0e95df6b545d68c3593)) +* upgrade dompurify from 2.2.7 to 2.2.8 ([#1577](https://github.com/docsifyjs/docsify/issues/1577)) ([0dd44cc](https://github.com/docsifyjs/docsify/commit/0dd44cc828cc54f7c3b776d45b32925b66cae499)) +* upgrade dompurify from 2.2.7 to 2.3.0 ([#1619](https://github.com/docsifyjs/docsify/issues/1619)) ([66303fe](https://github.com/docsifyjs/docsify/commit/66303fec4c7115621e556ad742cfac9d19f26bd9)) +* upgrade dompurify from 2.2.8 to 2.2.9 ([#1600](https://github.com/docsifyjs/docsify/issues/1600)) ([baf5a8a](https://github.com/docsifyjs/docsify/commit/baf5a8a4962656d8be8f714283064d2ea10c7e14)) +* upgrade dompurify from 2.2.9 to 2.3.0 ([#1616](https://github.com/docsifyjs/docsify/issues/1616)) ([b07fa3c](https://github.com/docsifyjs/docsify/commit/b07fa3cc8323e63dd7b105c7e29b2e1914f5c117)) +* upgrade dompurify from 2.3.0 to 2.3.1 ([#1635](https://github.com/docsifyjs/docsify/issues/1635)) ([5ac8237](https://github.com/docsifyjs/docsify/commit/5ac8237cc76e19ca2b373a1a1da6eb4a4da6d8b2)) +* upgrade dompurify from 2.3.1 to 2.3.2 ([#1647](https://github.com/docsifyjs/docsify/issues/1647)) ([ff6acfa](https://github.com/docsifyjs/docsify/commit/ff6acfa7623a7db8b00d62c51a9c3037215c4888)) +* upgrade node-fetch from 2.6.1 to 2.6.2 ([#1641](https://github.com/docsifyjs/docsify/issues/1641)) ([6ee1c14](https://github.com/docsifyjs/docsify/commit/6ee1c142769a6442aa8c1523ab215106707fa7fc)) +* upgrade node-fetch from 2.6.2 to 2.6.4 ([#1649](https://github.com/docsifyjs/docsify/issues/1649)) ([6f81034](https://github.com/docsifyjs/docsify/commit/6f81034ba6a7a6b64ccf1acd2d1fc73761f70a63)) +* upgrade node-fetch from 2.6.4 to 2.6.5 ([#1654](https://github.com/docsifyjs/docsify/issues/1654)) ([d16e657](https://github.com/docsifyjs/docsify/commit/d16e657f708777e8377d8e158b50b4010623282d)) +* upgrade node-fetch from 2.6.5 to 2.6.6 ([#1668](https://github.com/docsifyjs/docsify/issues/1668)) ([cefe3f8](https://github.com/docsifyjs/docsify/commit/cefe3f87e697a6c54a74d601df2eeb331fcd8933)) + + + ## [4.12.1](https://github.com/docsifyjs/docsify/compare/v4.12.0...v4.12.1) (2021-03-07) diff --git a/package-lock.json b/package-lock.json index 8fb5273e1..f5b83ae14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "docsify", - "version": "4.12.1", + "version": "4.12.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 338e4aa95..018c213bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "docsify", - "version": "4.12.1", + "version": "4.12.2", "description": "A magical documentation generator.", "author": { "name": "qingwei-li", From e424a9d2257fd1dcd3b6965fdee7a19ed6e44ec3 Mon Sep 17 00:00:00 2001 From: i544693 <369491420@qq.com> Date: Thu, 6 Jan 2022 17:12:13 +0800 Subject: [PATCH 60/60] chore: update test snapshots. --- test/integration/__snapshots__/docs.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/__snapshots__/docs.test.js.snap b/test/integration/__snapshots__/docs.test.js.snap index da8c0e1f5..34b7c70e0 100644 --- a/test/integration/__snapshots__/docs.test.js.snap +++ b/test/integration/__snapshots__/docs.test.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Docs Site coverpage renders and is unchanged 1`] = ` -"

\\"logo\\"

docsify 4.12.1

+"

\\"logo\\"

docsify 4.12.2

A magical documentation site generator.

  • Simple and lightweight
  • No statically built html files
  • Multiple themes

GitHub Getting Started

"