@alexlit/lint-kit 107.0.0 → 107.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -11
- package/packages/config-commitlint/package.json +2 -2
- package/packages/config-eslint/package.json +4 -4
- package/packages/config-hooks/package.json +3 -3
- package/packages/config-markdownlint/node_modules/markdown-it/LICENSE +22 -0
- package/packages/config-markdownlint/node_modules/markdown-it/README.md +309 -0
- package/packages/config-markdownlint/node_modules/markdown-it/bin/markdown-it.js +117 -0
- package/packages/config-markdownlint/node_modules/markdown-it/dist/markdown-it.js +8441 -0
- package/packages/config-markdownlint/node_modules/markdown-it/dist/markdown-it.min.js +3 -0
- package/packages/config-markdownlint/node_modules/markdown-it/index.js +4 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/common/entities.js +6 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/common/html_blocks.js +70 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/common/html_re.js +28 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/common/utils.js +317 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/index.js +7 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_destination.js +80 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_label.js +48 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/helpers/parse_link_title.js +55 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/index.js +582 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_block.js +131 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_core.js +61 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/parser_inline.js +192 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/commonmark.js +81 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/default.js +41 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/presets/zero.js +63 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/renderer.js +341 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/ruler.js +352 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/blockquote.js +226 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/code.js +34 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/fence.js +98 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/heading.js +55 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/hr.js +45 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/html_block.js +74 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/lheading.js +83 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/list.js +362 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/paragraph.js +51 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/reference.js +198 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/state_block.js +231 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_block/table.js +221 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/block.js +16 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/inline.js +13 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/linkify.js +142 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/normalize.js +21 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/replacements.js +105 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/smartquotes.js +201 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/state_core.js +20 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_core/text_join.js +45 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/autolink.js +76 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/backticks.js +63 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/balance_pairs.js +130 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/emphasis.js +130 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/entity.js +55 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/escape.js +71 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/fragments_join.js +41 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/html_inline.js +58 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/image.js +152 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/link.js +150 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/linkify.js +62 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/newline.js +46 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/state_inline.js +158 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/strikethrough.js +130 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/rules_inline/text.js +89 -0
- package/packages/config-markdownlint/node_modules/markdown-it/lib/token.js +201 -0
- package/packages/config-markdownlint/node_modules/markdown-it/package.json +87 -0
- package/packages/config-markdownlint/node_modules/markdownlint/CHANGELOG.md +428 -0
- package/packages/config-markdownlint/node_modules/markdownlint/CONTRIBUTING.md +92 -0
- package/packages/config-markdownlint/node_modules/markdownlint/LICENSE +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/README.md +1026 -0
- package/packages/config-markdownlint/node_modules/markdownlint/demo/markdownlint-browser.js +6814 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/CustomRules.md +376 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/Prettier.md +27 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/ReleaseProcess.md +20 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/Rules.md +2335 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md001.md +37 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md003.md +59 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md004.md +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md005.md +53 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md007.md +52 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md009.md +51 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md010.md +56 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md011.md +30 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md012.md +38 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md013.md +57 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md014.md +54 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md018.md +27 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md019.md +28 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md020.md +29 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md021.md +31 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md022.md +52 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md023.md +33 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md024.md +47 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md025.md +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md026.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md027.md +24 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md028.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md029.md +98 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md030.md +82 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md031.md +50 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md032.md +55 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md033.md +27 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md034.md +50 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md035.md +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md036.md +45 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md037.md +37 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md038.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md039.md +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md040.md +52 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md041.md +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md042.md +32 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md043.md +69 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md044.md +35 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md045.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md046.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md047.md +34 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md048.md +41 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md049.md +32 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md050.md +32 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md051.md +61 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md052.md +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md053.md +38 -0
- package/packages/config-markdownlint/node_modules/markdownlint/doc/md054.md +100 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/LICENSE +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/README.md +70 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/helpers.js +1025 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/micromark.cjs +426 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/package.json +26 -0
- package/packages/config-markdownlint/node_modules/markdownlint/helpers/shared.js +10 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/cache.js +21 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/configuration.d.ts +1152 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/constants.js +14 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.d.ts +406 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.js +1476 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md001.js +22 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md003.js +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md004.js +76 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md005.js +73 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md007.js +86 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md009.js +86 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md010.js +60 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md011.js +46 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md012.js +32 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md013.js +96 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md014.js +53 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md018.js +34 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md019.js +39 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md020.js +62 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md021.js +62 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md022.js +108 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md023.js +38 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md024.js +38 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md025.js +32 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md026.js +50 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md027.js +56 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md028.js +30 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md029.js +67 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md030.js +61 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md031.js +40 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md032.js +78 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md033.js +39 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md034.js +79 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md035.js +24 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md036.js +56 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md037.js +91 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md038.js +97 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md039.js +67 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md040.js +37 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md041.js +42 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md042.js +49 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md043.js +64 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md044.js +107 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md045.js +60 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md046.js +33 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md047.js +28 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md048.js +30 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md049-md050.js +89 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md051.js +172 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md052.js +39 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md053.js +59 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/md054.js +125 -0
- package/packages/config-markdownlint/node_modules/markdownlint/lib/rules.js +65 -0
- package/packages/config-markdownlint/node_modules/markdownlint/package.json +109 -0
- package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.jsonc +297 -0
- package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.yaml +266 -0
- package/packages/config-markdownlint/node_modules/markdownlint/schema/markdownlint-config-schema.json +1762 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/all.json +5 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/cirosantilli.json +22 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/prettier.json +26 -0
- package/packages/config-markdownlint/node_modules/markdownlint/style/relaxed.json +12 -0
- package/packages/config-markdownlint/package.json +3 -3
- package/packages/config-prettier/README.md +16 -0
- package/packages/config-prettier/package.json +4 -4
- package/packages/config-stylelint/package.json +2 -2
- package/scripts/semver.sh +6 -5
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
// Block quotes
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
var isSpace = require('../common/utils').isSpace;
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module.exports = function blockquote(state, startLine, endLine, silent) {
|
|
9
|
+
var adjustTab,
|
|
10
|
+
ch,
|
|
11
|
+
i,
|
|
12
|
+
initial,
|
|
13
|
+
l,
|
|
14
|
+
lastLineEmpty,
|
|
15
|
+
lines,
|
|
16
|
+
nextLine,
|
|
17
|
+
offset,
|
|
18
|
+
oldBMarks,
|
|
19
|
+
oldBSCount,
|
|
20
|
+
oldIndent,
|
|
21
|
+
oldParentType,
|
|
22
|
+
oldSCount,
|
|
23
|
+
oldTShift,
|
|
24
|
+
spaceAfterMarker,
|
|
25
|
+
terminate,
|
|
26
|
+
terminatorRules,
|
|
27
|
+
token,
|
|
28
|
+
isOutdented,
|
|
29
|
+
oldLineMax = state.lineMax,
|
|
30
|
+
pos = state.bMarks[startLine] + state.tShift[startLine],
|
|
31
|
+
max = state.eMarks[startLine];
|
|
32
|
+
|
|
33
|
+
// if it's indented more than 3 spaces, it should be a code block
|
|
34
|
+
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
|
|
35
|
+
|
|
36
|
+
// check the block quote marker
|
|
37
|
+
if (state.src.charCodeAt(pos) !== 0x3E/* > */) { return false; }
|
|
38
|
+
|
|
39
|
+
// we know that it's going to be a valid blockquote,
|
|
40
|
+
// so no point trying to find the end of it in silent mode
|
|
41
|
+
if (silent) { return true; }
|
|
42
|
+
|
|
43
|
+
oldBMarks = [];
|
|
44
|
+
oldBSCount = [];
|
|
45
|
+
oldSCount = [];
|
|
46
|
+
oldTShift = [];
|
|
47
|
+
|
|
48
|
+
terminatorRules = state.md.block.ruler.getRules('blockquote');
|
|
49
|
+
|
|
50
|
+
oldParentType = state.parentType;
|
|
51
|
+
state.parentType = 'blockquote';
|
|
52
|
+
|
|
53
|
+
// Search the end of the block
|
|
54
|
+
//
|
|
55
|
+
// Block ends with either:
|
|
56
|
+
// 1. an empty line outside:
|
|
57
|
+
// ```
|
|
58
|
+
// > test
|
|
59
|
+
//
|
|
60
|
+
// ```
|
|
61
|
+
// 2. an empty line inside:
|
|
62
|
+
// ```
|
|
63
|
+
// >
|
|
64
|
+
// test
|
|
65
|
+
// ```
|
|
66
|
+
// 3. another tag:
|
|
67
|
+
// ```
|
|
68
|
+
// > test
|
|
69
|
+
// - - -
|
|
70
|
+
// ```
|
|
71
|
+
for (nextLine = startLine; nextLine < endLine; nextLine++) {
|
|
72
|
+
// check if it's outdented, i.e. it's inside list item and indented
|
|
73
|
+
// less than said list item:
|
|
74
|
+
//
|
|
75
|
+
// ```
|
|
76
|
+
// 1. anything
|
|
77
|
+
// > current blockquote
|
|
78
|
+
// 2. checking this line
|
|
79
|
+
// ```
|
|
80
|
+
isOutdented = state.sCount[nextLine] < state.blkIndent;
|
|
81
|
+
|
|
82
|
+
pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
83
|
+
max = state.eMarks[nextLine];
|
|
84
|
+
|
|
85
|
+
if (pos >= max) {
|
|
86
|
+
// Case 1: line is not inside the blockquote, and this line is empty.
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (state.src.charCodeAt(pos++) === 0x3E/* > */ && !isOutdented) {
|
|
91
|
+
// This line is inside the blockquote.
|
|
92
|
+
|
|
93
|
+
// set offset past spaces and ">"
|
|
94
|
+
initial = state.sCount[nextLine] + 1;
|
|
95
|
+
|
|
96
|
+
// skip one optional space after '>'
|
|
97
|
+
if (state.src.charCodeAt(pos) === 0x20 /* space */) {
|
|
98
|
+
// ' > test '
|
|
99
|
+
// ^ -- position start of line here:
|
|
100
|
+
pos++;
|
|
101
|
+
initial++;
|
|
102
|
+
adjustTab = false;
|
|
103
|
+
spaceAfterMarker = true;
|
|
104
|
+
} else if (state.src.charCodeAt(pos) === 0x09 /* tab */) {
|
|
105
|
+
spaceAfterMarker = true;
|
|
106
|
+
|
|
107
|
+
if ((state.bsCount[nextLine] + initial) % 4 === 3) {
|
|
108
|
+
// ' >\t test '
|
|
109
|
+
// ^ -- position start of line here (tab has width===1)
|
|
110
|
+
pos++;
|
|
111
|
+
initial++;
|
|
112
|
+
adjustTab = false;
|
|
113
|
+
} else {
|
|
114
|
+
// ' >\t test '
|
|
115
|
+
// ^ -- position start of line here + shift bsCount slightly
|
|
116
|
+
// to make extra space appear
|
|
117
|
+
adjustTab = true;
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
spaceAfterMarker = false;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
offset = initial;
|
|
124
|
+
oldBMarks.push(state.bMarks[nextLine]);
|
|
125
|
+
state.bMarks[nextLine] = pos;
|
|
126
|
+
|
|
127
|
+
while (pos < max) {
|
|
128
|
+
ch = state.src.charCodeAt(pos);
|
|
129
|
+
|
|
130
|
+
if (isSpace(ch)) {
|
|
131
|
+
if (ch === 0x09) {
|
|
132
|
+
offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
|
|
133
|
+
} else {
|
|
134
|
+
offset++;
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
pos++;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
lastLineEmpty = pos >= max;
|
|
144
|
+
|
|
145
|
+
oldBSCount.push(state.bsCount[nextLine]);
|
|
146
|
+
state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
|
|
147
|
+
|
|
148
|
+
oldSCount.push(state.sCount[nextLine]);
|
|
149
|
+
state.sCount[nextLine] = offset - initial;
|
|
150
|
+
|
|
151
|
+
oldTShift.push(state.tShift[nextLine]);
|
|
152
|
+
state.tShift[nextLine] = pos - state.bMarks[nextLine];
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Case 2: line is not inside the blockquote, and the last line was empty.
|
|
157
|
+
if (lastLineEmpty) { break; }
|
|
158
|
+
|
|
159
|
+
// Case 3: another tag found.
|
|
160
|
+
terminate = false;
|
|
161
|
+
for (i = 0, l = terminatorRules.length; i < l; i++) {
|
|
162
|
+
if (terminatorRules[i](state, nextLine, endLine, true)) {
|
|
163
|
+
terminate = true;
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (terminate) {
|
|
169
|
+
// Quirk to enforce "hard termination mode" for paragraphs;
|
|
170
|
+
// normally if you call `tokenize(state, startLine, nextLine)`,
|
|
171
|
+
// paragraphs will look below nextLine for paragraph continuation,
|
|
172
|
+
// but if blockquote is terminated by another tag, they shouldn't
|
|
173
|
+
state.lineMax = nextLine;
|
|
174
|
+
|
|
175
|
+
if (state.blkIndent !== 0) {
|
|
176
|
+
// state.blkIndent was non-zero, we now set it to zero,
|
|
177
|
+
// so we need to re-calculate all offsets to appear as
|
|
178
|
+
// if indent wasn't changed
|
|
179
|
+
oldBMarks.push(state.bMarks[nextLine]);
|
|
180
|
+
oldBSCount.push(state.bsCount[nextLine]);
|
|
181
|
+
oldTShift.push(state.tShift[nextLine]);
|
|
182
|
+
oldSCount.push(state.sCount[nextLine]);
|
|
183
|
+
state.sCount[nextLine] -= state.blkIndent;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
oldBMarks.push(state.bMarks[nextLine]);
|
|
190
|
+
oldBSCount.push(state.bsCount[nextLine]);
|
|
191
|
+
oldTShift.push(state.tShift[nextLine]);
|
|
192
|
+
oldSCount.push(state.sCount[nextLine]);
|
|
193
|
+
|
|
194
|
+
// A negative indentation means that this is a paragraph continuation
|
|
195
|
+
//
|
|
196
|
+
state.sCount[nextLine] = -1;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
oldIndent = state.blkIndent;
|
|
200
|
+
state.blkIndent = 0;
|
|
201
|
+
|
|
202
|
+
token = state.push('blockquote_open', 'blockquote', 1);
|
|
203
|
+
token.markup = '>';
|
|
204
|
+
token.map = lines = [ startLine, 0 ];
|
|
205
|
+
|
|
206
|
+
state.md.block.tokenize(state, startLine, nextLine);
|
|
207
|
+
|
|
208
|
+
token = state.push('blockquote_close', 'blockquote', -1);
|
|
209
|
+
token.markup = '>';
|
|
210
|
+
|
|
211
|
+
state.lineMax = oldLineMax;
|
|
212
|
+
state.parentType = oldParentType;
|
|
213
|
+
lines[1] = state.line;
|
|
214
|
+
|
|
215
|
+
// Restore original tShift; this might not be necessary since the parser
|
|
216
|
+
// has already been here, but just to make sure we can do that.
|
|
217
|
+
for (i = 0; i < oldTShift.length; i++) {
|
|
218
|
+
state.bMarks[i + startLine] = oldBMarks[i];
|
|
219
|
+
state.tShift[i + startLine] = oldTShift[i];
|
|
220
|
+
state.sCount[i + startLine] = oldSCount[i];
|
|
221
|
+
state.bsCount[i + startLine] = oldBSCount[i];
|
|
222
|
+
}
|
|
223
|
+
state.blkIndent = oldIndent;
|
|
224
|
+
|
|
225
|
+
return true;
|
|
226
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Code block (4 spaces padded)
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
module.exports = function code(state, startLine, endLine/*, silent*/) {
|
|
7
|
+
var nextLine, last, token;
|
|
8
|
+
|
|
9
|
+
if (state.sCount[startLine] - state.blkIndent < 4) { return false; }
|
|
10
|
+
|
|
11
|
+
last = nextLine = startLine + 1;
|
|
12
|
+
|
|
13
|
+
while (nextLine < endLine) {
|
|
14
|
+
if (state.isEmpty(nextLine)) {
|
|
15
|
+
nextLine++;
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (state.sCount[nextLine] - state.blkIndent >= 4) {
|
|
20
|
+
nextLine++;
|
|
21
|
+
last = nextLine;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
break;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
state.line = last;
|
|
28
|
+
|
|
29
|
+
token = state.push('code_block', 'code', 0);
|
|
30
|
+
token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\n';
|
|
31
|
+
token.map = [ startLine, state.line ];
|
|
32
|
+
|
|
33
|
+
return true;
|
|
34
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
// fences (``` lang, ~~~ lang)
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
module.exports = function fence(state, startLine, endLine, silent) {
|
|
7
|
+
var marker, len, params, nextLine, mem, token, markup,
|
|
8
|
+
haveEndMarker = false,
|
|
9
|
+
pos = state.bMarks[startLine] + state.tShift[startLine],
|
|
10
|
+
max = state.eMarks[startLine];
|
|
11
|
+
|
|
12
|
+
// if it's indented more than 3 spaces, it should be a code block
|
|
13
|
+
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
|
|
14
|
+
|
|
15
|
+
if (pos + 3 > max) { return false; }
|
|
16
|
+
|
|
17
|
+
marker = state.src.charCodeAt(pos);
|
|
18
|
+
|
|
19
|
+
if (marker !== 0x7E/* ~ */ && marker !== 0x60 /* ` */) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// scan marker length
|
|
24
|
+
mem = pos;
|
|
25
|
+
pos = state.skipChars(pos, marker);
|
|
26
|
+
|
|
27
|
+
len = pos - mem;
|
|
28
|
+
|
|
29
|
+
if (len < 3) { return false; }
|
|
30
|
+
|
|
31
|
+
markup = state.src.slice(mem, pos);
|
|
32
|
+
params = state.src.slice(pos, max);
|
|
33
|
+
|
|
34
|
+
if (marker === 0x60 /* ` */) {
|
|
35
|
+
if (params.indexOf(String.fromCharCode(marker)) >= 0) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Since start is found, we can report success here in validation mode
|
|
41
|
+
if (silent) { return true; }
|
|
42
|
+
|
|
43
|
+
// search end of block
|
|
44
|
+
nextLine = startLine;
|
|
45
|
+
|
|
46
|
+
for (;;) {
|
|
47
|
+
nextLine++;
|
|
48
|
+
if (nextLine >= endLine) {
|
|
49
|
+
// unclosed block should be autoclosed by end of document.
|
|
50
|
+
// also block seems to be autoclosed by end of parent
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
55
|
+
max = state.eMarks[nextLine];
|
|
56
|
+
|
|
57
|
+
if (pos < max && state.sCount[nextLine] < state.blkIndent) {
|
|
58
|
+
// non-empty line with negative indent should stop the list:
|
|
59
|
+
// - ```
|
|
60
|
+
// test
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (state.src.charCodeAt(pos) !== marker) { continue; }
|
|
65
|
+
|
|
66
|
+
if (state.sCount[nextLine] - state.blkIndent >= 4) {
|
|
67
|
+
// closing fence should be indented less than 4 spaces
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
pos = state.skipChars(pos, marker);
|
|
72
|
+
|
|
73
|
+
// closing code fence must be at least as long as the opening one
|
|
74
|
+
if (pos - mem < len) { continue; }
|
|
75
|
+
|
|
76
|
+
// make sure tail has spaces only
|
|
77
|
+
pos = state.skipSpaces(pos);
|
|
78
|
+
|
|
79
|
+
if (pos < max) { continue; }
|
|
80
|
+
|
|
81
|
+
haveEndMarker = true;
|
|
82
|
+
// found!
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// If a fence has heading spaces, they should be removed from its inner block
|
|
87
|
+
len = state.sCount[startLine];
|
|
88
|
+
|
|
89
|
+
state.line = nextLine + (haveEndMarker ? 1 : 0);
|
|
90
|
+
|
|
91
|
+
token = state.push('fence', 'code', 0);
|
|
92
|
+
token.info = params;
|
|
93
|
+
token.content = state.getLines(startLine + 1, nextLine, len, true);
|
|
94
|
+
token.markup = markup;
|
|
95
|
+
token.map = [ startLine, state.line ];
|
|
96
|
+
|
|
97
|
+
return true;
|
|
98
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// heading (#, ##, ...)
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
var isSpace = require('../common/utils').isSpace;
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module.exports = function heading(state, startLine, endLine, silent) {
|
|
9
|
+
var ch, level, tmp, token,
|
|
10
|
+
pos = state.bMarks[startLine] + state.tShift[startLine],
|
|
11
|
+
max = state.eMarks[startLine];
|
|
12
|
+
|
|
13
|
+
// if it's indented more than 3 spaces, it should be a code block
|
|
14
|
+
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
|
|
15
|
+
|
|
16
|
+
ch = state.src.charCodeAt(pos);
|
|
17
|
+
|
|
18
|
+
if (ch !== 0x23/* # */ || pos >= max) { return false; }
|
|
19
|
+
|
|
20
|
+
// count heading level
|
|
21
|
+
level = 1;
|
|
22
|
+
ch = state.src.charCodeAt(++pos);
|
|
23
|
+
while (ch === 0x23/* # */ && pos < max && level <= 6) {
|
|
24
|
+
level++;
|
|
25
|
+
ch = state.src.charCodeAt(++pos);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (level > 6 || (pos < max && !isSpace(ch))) { return false; }
|
|
29
|
+
|
|
30
|
+
if (silent) { return true; }
|
|
31
|
+
|
|
32
|
+
// Let's cut tails like ' ### ' from the end of string
|
|
33
|
+
|
|
34
|
+
max = state.skipSpacesBack(max, pos);
|
|
35
|
+
tmp = state.skipCharsBack(max, 0x23, pos); // #
|
|
36
|
+
if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
|
|
37
|
+
max = tmp;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
state.line = startLine + 1;
|
|
41
|
+
|
|
42
|
+
token = state.push('heading_open', 'h' + String(level), 1);
|
|
43
|
+
token.markup = '########'.slice(0, level);
|
|
44
|
+
token.map = [ startLine, state.line ];
|
|
45
|
+
|
|
46
|
+
token = state.push('inline', '', 0);
|
|
47
|
+
token.content = state.src.slice(pos, max).trim();
|
|
48
|
+
token.map = [ startLine, state.line ];
|
|
49
|
+
token.children = [];
|
|
50
|
+
|
|
51
|
+
token = state.push('heading_close', 'h' + String(level), -1);
|
|
52
|
+
token.markup = '########'.slice(0, level);
|
|
53
|
+
|
|
54
|
+
return true;
|
|
55
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Horizontal rule
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
var isSpace = require('../common/utils').isSpace;
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
module.exports = function hr(state, startLine, endLine, silent) {
|
|
9
|
+
var marker, cnt, ch, token,
|
|
10
|
+
pos = state.bMarks[startLine] + state.tShift[startLine],
|
|
11
|
+
max = state.eMarks[startLine];
|
|
12
|
+
|
|
13
|
+
// if it's indented more than 3 spaces, it should be a code block
|
|
14
|
+
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
|
|
15
|
+
|
|
16
|
+
marker = state.src.charCodeAt(pos++);
|
|
17
|
+
|
|
18
|
+
// Check hr marker
|
|
19
|
+
if (marker !== 0x2A/* * */ &&
|
|
20
|
+
marker !== 0x2D/* - */ &&
|
|
21
|
+
marker !== 0x5F/* _ */) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// markers can be mixed with spaces, but there should be at least 3 of them
|
|
26
|
+
|
|
27
|
+
cnt = 1;
|
|
28
|
+
while (pos < max) {
|
|
29
|
+
ch = state.src.charCodeAt(pos++);
|
|
30
|
+
if (ch !== marker && !isSpace(ch)) { return false; }
|
|
31
|
+
if (ch === marker) { cnt++; }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (cnt < 3) { return false; }
|
|
35
|
+
|
|
36
|
+
if (silent) { return true; }
|
|
37
|
+
|
|
38
|
+
state.line = startLine + 1;
|
|
39
|
+
|
|
40
|
+
token = state.push('hr', 'hr', 0);
|
|
41
|
+
token.map = [ startLine, state.line ];
|
|
42
|
+
token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
|
|
43
|
+
|
|
44
|
+
return true;
|
|
45
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// HTML block
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var block_names = require('../common/html_blocks');
|
|
7
|
+
var HTML_OPEN_CLOSE_TAG_RE = require('../common/html_re').HTML_OPEN_CLOSE_TAG_RE;
|
|
8
|
+
|
|
9
|
+
// An array of opening and corresponding closing sequences for html tags,
|
|
10
|
+
// last argument defines whether it can terminate a paragraph or not
|
|
11
|
+
//
|
|
12
|
+
var HTML_SEQUENCES = [
|
|
13
|
+
[ /^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true ],
|
|
14
|
+
[ /^<!--/, /-->/, true ],
|
|
15
|
+
[ /^<\?/, /\?>/, true ],
|
|
16
|
+
[ /^<![A-Z]/, />/, true ],
|
|
17
|
+
[ /^<!\[CDATA\[/, /\]\]>/, true ],
|
|
18
|
+
[ new RegExp('^</?(' + block_names.join('|') + ')(?=(\\s|/?>|$))', 'i'), /^$/, true ],
|
|
19
|
+
[ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false ]
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
module.exports = function html_block(state, startLine, endLine, silent) {
|
|
24
|
+
var i, nextLine, token, lineText,
|
|
25
|
+
pos = state.bMarks[startLine] + state.tShift[startLine],
|
|
26
|
+
max = state.eMarks[startLine];
|
|
27
|
+
|
|
28
|
+
// if it's indented more than 3 spaces, it should be a code block
|
|
29
|
+
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
|
|
30
|
+
|
|
31
|
+
if (!state.md.options.html) { return false; }
|
|
32
|
+
|
|
33
|
+
if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false; }
|
|
34
|
+
|
|
35
|
+
lineText = state.src.slice(pos, max);
|
|
36
|
+
|
|
37
|
+
for (i = 0; i < HTML_SEQUENCES.length; i++) {
|
|
38
|
+
if (HTML_SEQUENCES[i][0].test(lineText)) { break; }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (i === HTML_SEQUENCES.length) { return false; }
|
|
42
|
+
|
|
43
|
+
if (silent) {
|
|
44
|
+
// true if this sequence can be a terminator, false otherwise
|
|
45
|
+
return HTML_SEQUENCES[i][2];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
nextLine = startLine + 1;
|
|
49
|
+
|
|
50
|
+
// If we are here - we detected HTML block.
|
|
51
|
+
// Let's roll down till block end.
|
|
52
|
+
if (!HTML_SEQUENCES[i][1].test(lineText)) {
|
|
53
|
+
for (; nextLine < endLine; nextLine++) {
|
|
54
|
+
if (state.sCount[nextLine] < state.blkIndent) { break; }
|
|
55
|
+
|
|
56
|
+
pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
57
|
+
max = state.eMarks[nextLine];
|
|
58
|
+
lineText = state.src.slice(pos, max);
|
|
59
|
+
|
|
60
|
+
if (HTML_SEQUENCES[i][1].test(lineText)) {
|
|
61
|
+
if (lineText.length !== 0) { nextLine++; }
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
state.line = nextLine;
|
|
68
|
+
|
|
69
|
+
token = state.push('html_block', '', 0);
|
|
70
|
+
token.map = [ startLine, nextLine ];
|
|
71
|
+
token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
|
|
72
|
+
|
|
73
|
+
return true;
|
|
74
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// lheading (---, ===)
|
|
2
|
+
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
module.exports = function lheading(state, startLine, endLine/*, silent*/) {
|
|
7
|
+
var content, terminate, i, l, token, pos, max, level, marker,
|
|
8
|
+
nextLine = startLine + 1, oldParentType,
|
|
9
|
+
terminatorRules = state.md.block.ruler.getRules('paragraph');
|
|
10
|
+
|
|
11
|
+
// if it's indented more than 3 spaces, it should be a code block
|
|
12
|
+
if (state.sCount[startLine] - state.blkIndent >= 4) { return false; }
|
|
13
|
+
|
|
14
|
+
oldParentType = state.parentType;
|
|
15
|
+
state.parentType = 'paragraph'; // use paragraph to match terminatorRules
|
|
16
|
+
|
|
17
|
+
// jump line-by-line until empty one or EOF
|
|
18
|
+
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
|
|
19
|
+
// this would be a code block normally, but after paragraph
|
|
20
|
+
// it's considered a lazy continuation regardless of what's there
|
|
21
|
+
if (state.sCount[nextLine] - state.blkIndent > 3) { continue; }
|
|
22
|
+
|
|
23
|
+
//
|
|
24
|
+
// Check for underline in setext header
|
|
25
|
+
//
|
|
26
|
+
if (state.sCount[nextLine] >= state.blkIndent) {
|
|
27
|
+
pos = state.bMarks[nextLine] + state.tShift[nextLine];
|
|
28
|
+
max = state.eMarks[nextLine];
|
|
29
|
+
|
|
30
|
+
if (pos < max) {
|
|
31
|
+
marker = state.src.charCodeAt(pos);
|
|
32
|
+
|
|
33
|
+
if (marker === 0x2D/* - */ || marker === 0x3D/* = */) {
|
|
34
|
+
pos = state.skipChars(pos, marker);
|
|
35
|
+
pos = state.skipSpaces(pos);
|
|
36
|
+
|
|
37
|
+
if (pos >= max) {
|
|
38
|
+
level = (marker === 0x3D/* = */ ? 1 : 2);
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// quirk for blockquotes, this line should already be checked by that rule
|
|
46
|
+
if (state.sCount[nextLine] < 0) { continue; }
|
|
47
|
+
|
|
48
|
+
// Some tags can terminate paragraph without empty line.
|
|
49
|
+
terminate = false;
|
|
50
|
+
for (i = 0, l = terminatorRules.length; i < l; i++) {
|
|
51
|
+
if (terminatorRules[i](state, nextLine, endLine, true)) {
|
|
52
|
+
terminate = true;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (terminate) { break; }
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (!level) {
|
|
60
|
+
// Didn't find valid underline
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
|
|
65
|
+
|
|
66
|
+
state.line = nextLine + 1;
|
|
67
|
+
|
|
68
|
+
token = state.push('heading_open', 'h' + String(level), 1);
|
|
69
|
+
token.markup = String.fromCharCode(marker);
|
|
70
|
+
token.map = [ startLine, state.line ];
|
|
71
|
+
|
|
72
|
+
token = state.push('inline', '', 0);
|
|
73
|
+
token.content = content;
|
|
74
|
+
token.map = [ startLine, state.line - 1 ];
|
|
75
|
+
token.children = [];
|
|
76
|
+
|
|
77
|
+
token = state.push('heading_close', 'h' + String(level), -1);
|
|
78
|
+
token.markup = String.fromCharCode(marker);
|
|
79
|
+
|
|
80
|
+
state.parentType = oldParentType;
|
|
81
|
+
|
|
82
|
+
return true;
|
|
83
|
+
};
|