Skip to content

Commit 52f36aa

Browse files
authored
Merge branch 'develop' into fix/381
2 parents 0d2f55f + c90c6a4 commit 52f36aa

23 files changed

+718
-570
lines changed

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM mcr.microsoft.com/playwright:focal
2+
WORKDIR /app
3+
COPY . .
4+
RUN rm package-lock.json
5+
RUN npm install
6+
RUN npx playwright install
7+
RUN npm run build
8+
ENTRYPOINT ["npm", "run"]
9+
CMD ["test"]

SECURITY.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Security Policy
2+
3+
If you believe you have found a security vulnerability in docsify, please report it to us asap.
4+
5+
## Reporting a Vulnerability
6+
7+
**Please do not report security vulnerabilities through our public GitHub issues.**
8+
9+
Send email via :email: maintainers@docsifyjs.org to us.
10+
11+
Please include as much of the following information as possible to help us better understand the possible issue:
12+
13+
- Type of issue (e.g. cross-site scripting)
14+
- Full paths of source file(s) related to the manifestation of the issue
15+
- The location of the affected source code (tag/branch/commit or direct URL)
16+
- Any special configuration required to reproduce the issue
17+
- Step-by-step instructions to reproduce the issue
18+
- Proof-of-concept or exploit code
19+
- Impact of the issue, including how an attacker might exploit the issue
20+
21+
This information will help us triage your report more quickly.
22+
23+
Thank you in advance.

docs/configuration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ window.$docsify = {
301301

302302
// For each route
303303
nameLink: {
304-
'/zh-cn/': '/zh-cn/',
305-
'/': '/',
304+
'/zh-cn/': '#/zh-cn/',
305+
'/': '#/',
306306
},
307307
};
308308
```
@@ -508,9 +508,9 @@ window.$docsify = {
508508

509509
## noCompileLinks
510510

511-
- type: `Array`
511+
- type: `Array<string>`
512512

513-
Sometimes we do not want docsify to handle our links. See [#203](https://github.com/docsifyjs/docsify/issues/203)
513+
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.
514514

515515
```js
516516
window.$docsify = {

docs/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@
9595
id: 6,
9696
},
9797
name: 'docsify',
98+
nameLink: {
99+
'/es/': '#/es/',
100+
'/de-de/': '#/de-de/',
101+
'/ru-ru/': '#/ru-ru/',
102+
'/zh-cn/': '#/zh-cn/',
103+
'/': '#/',
104+
},
98105
search: {
99106
noData: {
100107
'/es/': '¡No hay resultados!',

docs/language-highlight.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,13 @@ function getAdder(int $x): int
5151
return 123;
5252
}
5353
```
54+
55+
## Highlighting Dynamic Content
56+
Code blocks [dynamically created from javascript](https://docsify.js.org/#/configuration?id=executescript) can be highlighted using the method `Prism.highlightElement` like so:
57+
58+
```javascript
59+
var code = document.createElement("code");
60+
code.innerHTML = "console.log('Hello World!')";
61+
code.setAttribute("class", "lang-javascript");
62+
Prism.highlightElement(code);
63+
```

docs/write-a-plugin.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ window.$docsify = {
7575

7676
```js
7777
window.$docsify = {
78+
// The date template pattern
79+
formatUpdated: '{YYYY}/{MM}/{DD} {HH}:{mm}',
7880
plugins: [
7981
function(hook, vm) {
8082
hook.beforeEach(function(html) {

index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@
5959
maxLevel: 4,
6060
subMaxLevel: 2,
6161
name: 'docsify',
62+
nameLink: {
63+
'/es/': '#/es/',
64+
'/de-de/': '#/de-de/',
65+
'/ru-ru/': '#/ru-ru/',
66+
'/zh-cn/': '#/zh-cn/',
67+
'/': '#/',
68+
},
6269
search: {
6370
noData: {
6471
'/es/': '¡No hay resultados!',

package-lock.json

Lines changed: 69 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"lint": "eslint .",
2929
"fixlint": "eslint . --fix",
3030
"test": "jest",
31+
"build:test": "npm run build && npm test",
3132
"test:e2e": "jest --selectProjects e2e",
3233
"test:integration": "jest --selectProjects integration",
3334
"test:unit": "jest --selectProjects unit",
@@ -43,7 +44,16 @@
4344
"prepare": "npm run build",
4445
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
4546
"pub": "sh build/release.sh",
46-
"postinstall": "opencollective-postinstall"
47+
"postinstall": "opencollective-postinstall",
48+
"docker:build": "docker build -f Dockerfile -t docsify-test:local .",
49+
"docker:clean": "docker rmi docsify-test:local",
50+
"docker:rebuild": "npm run docker:clean && npm run docker:build",
51+
"docker:test": "npm run docker:cli -- test",
52+
"docker:build:test": "npm run docker:cli -- build:test",
53+
"docker:test:e2e": "npm run docker:cli -- test:e2e",
54+
"docker:test:integration": "npm run docker:cli -- test:integration",
55+
"docker:test:unit": "npm run docker:cli -- test:unit",
56+
"docker:cli": "docker run --rm -it --ipc=host --mount type=bind,source=$(pwd)/test,target=/app/test docsify-test:local"
4757
},
4858
"husky": {
4959
"hooks": {
@@ -54,7 +64,7 @@
5464
"*.js": "eslint --fix"
5565
},
5666
"dependencies": {
57-
"dompurify": "^2.2.9",
67+
"dompurify": "^2.3.1",
5868
"marked": "^1.2.9",
5969
"medium-zoom": "^1.0.6",
6070
"opencollective-postinstall": "^2.0.2",

0 commit comments

Comments
 (0)