Skip to content

Commit 0f6e6e7

Browse files
authored
Merge branch 'develop' into remove-stalebot
2 parents 55c3e9e + 7580dc4 commit 0f6e6e7

File tree

9 files changed

+89
-21
lines changed

9 files changed

+89
-21
lines changed

CHANGELOG.md

+21-12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [4.11.6](https://github.com/docsifyjs/docsify/compare/v4.11.5...v4.11.6) (2020-08-22)
2+
3+
4+
### Bug Fixes
5+
6+
* Add patch for {docsify-ignore} and {docsify-ignore-all} ([ce31607](https://github.com/docsifyjs/docsify/commit/ce316075e033afdbeb43ce01e284a29fe1870e38))
7+
8+
9+
110
## [4.11.5](https://github.com/docsifyjs/docsify/compare/v4.11.4...v4.11.5) (2020-08-21)
211

312

@@ -86,8 +95,8 @@
8695
* emojis in titles not working correctly and update ([#1016](https://github.com/docsifyjs/docsify/issues/1016)) ([b3d9b96](https://github.com/docsifyjs/docsify/commit/b3d9b966dfbb6f456c2c457da1d2a366e85d9190))
8796
* searching table content ([6184e50](https://github.com/docsifyjs/docsify/commit/6184e502629932ca71fdd0a1b10150d118f5a7c8))
8897
* stage modified files as part of pre-commit hook ([#985](https://github.com/docsifyjs/docsify/issues/985)) ([5b77b0f](https://github.com/docsifyjs/docsify/commit/5b77b0f628f056b7ebb6d0b617561d19964516a2))
89-
* config initialization and coercion ([#861](https://github.com/docsifyjs/docsify/pull/861))
90-
* strip indent when embedding code fragment ([#996](https://github.com/docsifyjs/docsify/pull/996))
98+
* config initialization and coercion ([#861](https://github.com/docsifyjs/docsify/pull/861))
99+
* strip indent when embedding code fragment ([#996](https://github.com/docsifyjs/docsify/pull/996))
91100
* Ensure autoHeader dom result is similar to parsed H1 ([#811](https://github.com/docsifyjs/docsify/pull/811))
92101
* upgrade docsify from 4.9.4 to 4.10.2 ([#1054](https://github.com/docsifyjs/docsify/issues/1054)) ([78290b2](https://github.com/docsifyjs/docsify/commit/78290b21038a3ae09c4c7438bd89b14ca4c02805))
93102
* upgrade medium-zoom from 1.0.4 to 1.0.5 ([39ebd73](https://github.com/docsifyjs/docsify/commit/39ebd73021290439180878cae32e663b9e60e214))
@@ -106,29 +115,29 @@
106115

107116
### Docs
108117

109-
* update docs for the `name` config option ([#992](https://github.com/docsifyjs/docsify/pull/992))
118+
* update docs for the `name` config option ([#992](https://github.com/docsifyjs/docsify/pull/992))
110119
* about cache ([#854](https://github.com/docsifyjs/docsify/pull/854))
111120
* removed FOSSA badge
112121
* documented `__colon__` tip ([#1025](https://github.com/docsifyjs/docsify/pull/1025))
113122

114123
### Chore
115124

116125
* Migrate relative links to absolute in embedded markdown ([#867](https://github.com/docsifyjs/docsify/pull/867))
117-
* smarter scroll behavior ([#744](https://github.com/docsifyjs/docsify/pull/744))
126+
* smarter scroll behavior ([#744](https://github.com/docsifyjs/docsify/pull/744))
118127
* improve basic layout style ([#884](https://github.com/docsifyjs/docsify/pull/884))
119-
* There are currently {three=>four} themes available. ([#892](https://github.com/docsifyjs/docsify/pull/892))
120-
* Added a redirect for images to show up in Amplify ([#918](https://github.com/docsifyjs/docsify/pull/918))
128+
* There are currently {three=>four} themes available. ([#892](https://github.com/docsifyjs/docsify/pull/892))
129+
* Added a redirect for images to show up in Amplify ([#918](https://github.com/docsifyjs/docsify/pull/918))
121130
* removed the escaping of the name of sidebar ([#991](https://github.com/docsifyjs/docsify/pull/991))
122-
* Eslint fixes for v4x ([#989](https://github.com/docsifyjs/docsify/pull/989))
123-
* added github Actions for CI ([#1000](https://github.com/docsifyjs/docsify/pull/1000))
131+
* Eslint fixes for v4x ([#989](https://github.com/docsifyjs/docsify/pull/989))
132+
* added github Actions for CI ([#1000](https://github.com/docsifyjs/docsify/pull/1000))
124133
* Add a prepare script. ([#1010](https://github.com/docsifyjs/docsify/pull/1010))
125-
* chore(GH-action): using ubuntu 16 and removed node 8 from CI
134+
* chore(GH-action): using ubuntu 16 and removed node 8 from CI
126135
* chore: add config ([#1014](https://github.com/docsifyjs/docsify/pull/1014))
127136
* chore(stale): added enhancement label to exemptlabels
128137
* chore(stale): added bug label to exemptlabels
129-
* .markdown-section max-width 800px to 80% ([#1017](https://github.com/docsifyjs/docsify/pull/1017))
130-
* changed the CDN from unpkg to jsDelivr #1020 ([#1022](https://github.com/docsifyjs/docsify/pull/1022))
131-
* migrate CI to github, refactore CI and npm scripts, linting fixes ([#1023](https://github.com/docsifyjs/docsify/pull/1023))
138+
* .markdown-section max-width 800px to 80% ([#1017](https://github.com/docsifyjs/docsify/pull/1017))
139+
* changed the CDN from unpkg to jsDelivr #1020 ([#1022](https://github.com/docsifyjs/docsify/pull/1022))
140+
* migrate CI to github, refactore CI and npm scripts, linting fixes ([#1023](https://github.com/docsifyjs/docsify/pull/1023))
132141
* chore(readme): added CI badges and fixed the logo issue
133142
* added new linter config ([#1028](https://github.com/docsifyjs/docsify/pull/1028))
134143

docs/_coverpage.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![logo](_media/icon.svg)
22

3-
# docsify <small>4.11.5</small>
3+
# docsify <small>4.11.6</small>
44

55
> A magical documentation site generator.
66

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docsify",
3-
"version": "4.11.5",
3+
"version": "4.11.6",
44
"description": "A magical documentation generator.",
55
"author": {
66
"name": "qingwei-li",

packages/docsify-server-renderer/package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docsify-server-renderer/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docsify-server-renderer",
3-
"version": "4.11.5",
3+
"version": "4.11.6",
44
"description": "docsify server renderer",
55
"author": {
66
"name": "qingwei-li",

src/core/render/compiler.js

+12
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,24 @@ export class Compiler {
214214
nextToc.ignoreSubHeading = true;
215215
}
216216

217+
if (/{docsify-ignore}/g.test(str)) {
218+
str = str.replace('{docsify-ignore}', '');
219+
nextToc.title = str;
220+
nextToc.ignoreSubHeading = true;
221+
}
222+
217223
if (/<!-- {docsify-ignore-all} -->/g.test(str)) {
218224
str = str.replace('<!-- {docsify-ignore-all} -->', '');
219225
nextToc.title = str;
220226
nextToc.ignoreAllSubs = true;
221227
}
222228

229+
if (/{docsify-ignore-all}/g.test(str)) {
230+
str = str.replace('{docsify-ignore-all}', '');
231+
nextToc.title = str;
232+
nextToc.ignoreAllSubs = true;
233+
}
234+
223235
const slug = slugify(config.id || str);
224236
const url = router.toURL(router.getCurrentPath(), { id: slug });
225237
nextToc.slug = url;

src/core/render/compiler/headline.js

+12
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,24 @@ export const headingCompiler = ({ renderer, router, _self }) =>
1212
nextToc.ignoreSubHeading = true;
1313
}
1414

15+
if (/{docsify-ignore}/g.test(str)) {
16+
str = str.replace('{docsify-ignore}', '');
17+
nextToc.title = str;
18+
nextToc.ignoreSubHeading = true;
19+
}
20+
1521
if (/<!-- {docsify-ignore-all} -->/g.test(str)) {
1622
str = str.replace('<!-- {docsify-ignore-all} -->', '');
1723
nextToc.title = str;
1824
nextToc.ignoreAllSubs = true;
1925
}
2026

27+
if (/{docsify-ignore-all}/g.test(str)) {
28+
str = str.replace('{docsify-ignore-all}', '');
29+
nextToc.title = str;
30+
nextToc.ignoreAllSubs = true;
31+
}
32+
2133
const slug = slugify(config.id || str);
2234
const url = router.toURL(router.getCurrentPath(), { id: slug });
2335
nextToc.slug = url;

test/unit/render.test.js

+39-4
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,7 @@ describe('render', function() {
254254

255255
it('ignore', async function() {
256256
const { docsify } = await init();
257-
const output = docsify.compiler.compile(
258-
'## h2 tag <!-- {docsify-ignore} -->'
259-
);
257+
const output = docsify.compiler.compile('## h2 tag {docsify-ignore}');
260258
expectSameDom(
261259
output,
262260
`
@@ -268,10 +266,26 @@ describe('render', function() {
268266
);
269267
});
270268

269+
it('ignore-html-comments', async function() {
270+
const { docsify } = await init();
271+
const output = docsify.compiler.compile(
272+
'## h2 tag ignore <!-- {docsify-ignore} -->'
273+
);
274+
expectSameDom(
275+
output,
276+
`
277+
<h2 id="h2-tag-ignore">
278+
<a href="#/?id=h2-tag-ignore" data-id="h2-tag-ignore" class="anchor">
279+
<span>h2 tag ignore </span>
280+
</a>
281+
</h2>`
282+
);
283+
});
284+
271285
it('ignore-all', async function() {
272286
const { docsify } = await init();
273287
const output = docsify.compiler.compile(
274-
`# h1 tag <!-- {docsify-ignore-all} -->` + `\n## h2 tag`
288+
`# h1 tag {docsify-ignore-all}` + `\n## h2 tag`
275289
);
276290
expectSameDom(
277291
output,
@@ -288,6 +302,27 @@ describe('render', function() {
288302
</h2>`
289303
);
290304
});
305+
306+
it('ignore-all-html-comments', async function() {
307+
const { docsify } = await init();
308+
const output = docsify.compiler.compile(
309+
`# h1 tag ignore <!-- {docsify-ignore-all} -->` + `\n## h2 tag`
310+
);
311+
expectSameDom(
312+
output,
313+
`
314+
<h1 id="h1-tag-ignore">
315+
<a href="#/?id=h1-tag-ignore" data-id="h1-tag-ignore" class="anchor">
316+
<span>h1 tag ignore </span>
317+
</a>
318+
</h1>
319+
<h2 id="h2-tag">
320+
<a href="#/?id=h2-tag" data-id="h2-tag" class="anchor">
321+
<span>h2 tag</span>
322+
</a>
323+
</h2>`
324+
);
325+
});
291326
});
292327

293328
describe('link', function() {

0 commit comments

Comments
 (0)