@bernierllc/markdown-parser 1.0.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/.eslintrc.js +27 -0
- package/README.md +325 -0
- package/__tests__/MarkdownParser.test.ts +787 -0
- package/__tests__/ast-utils.test.ts +319 -0
- package/__tests__/cache.test.ts +243 -0
- package/__tests__/plugins.test.ts +282 -0
- package/coverage/clover.xml +283 -0
- package/coverage/coverage-final.json +7 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +146 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov-report/src/MarkdownParser.ts.html +1636 -0
- package/coverage/lcov-report/src/index.html +116 -0
- package/coverage/lcov-report/src/plugins/commonmark.ts.html +154 -0
- package/coverage/lcov-report/src/plugins/gfm.ts.html +154 -0
- package/coverage/lcov-report/src/plugins/index.html +146 -0
- package/coverage/lcov-report/src/plugins/index.ts.html +115 -0
- package/coverage/lcov-report/src/utils/ast-utils.ts.html +328 -0
- package/coverage/lcov-report/src/utils/cache.ts.html +403 -0
- package/coverage/lcov-report/src/utils/index.html +131 -0
- package/coverage/lcov.info +457 -0
- package/dist/MarkdownParser.d.ts +46 -0
- package/dist/MarkdownParser.d.ts.map +1 -0
- package/dist/MarkdownParser.js +458 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/plugins/commonmark.d.ts +6 -0
- package/dist/plugins/commonmark.d.ts.map +1 -0
- package/dist/plugins/commonmark.js +23 -0
- package/dist/plugins/gfm.d.ts +6 -0
- package/dist/plugins/gfm.d.ts.map +1 -0
- package/dist/plugins/gfm.js +23 -0
- package/dist/plugins/index.d.ts +3 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +25 -0
- package/dist/types.d.ts +78 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/utils/ast-utils.d.ts +22 -0
- package/dist/utils/ast-utils.d.ts.map +1 -0
- package/dist/utils/ast-utils.js +81 -0
- package/dist/utils/cache.d.ts +39 -0
- package/dist/utils/cache.d.ts.map +1 -0
- package/dist/utils/cache.js +91 -0
- package/jest.config.cjs +28 -0
- package/package.json +44 -0
- package/src/MarkdownParser.ts +517 -0
- package/src/index.ts +13 -0
- package/src/plugins/commonmark.ts +23 -0
- package/src/plugins/gfm.ts +23 -0
- package/src/plugins/index.ts +10 -0
- package/src/types.ts +114 -0
- package/src/utils/ast-utils.ts +81 -0
- package/src/utils/cache.ts +106 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2025 Bernier LLC
|
|
3
|
+
|
|
4
|
+
This file is licensed to the client under a limited-use license.
|
|
5
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { MarkdownParser } from '../src/MarkdownParser';
|
|
10
|
+
import { MarkdownPlugin } from '../src/types';
|
|
11
|
+
import { transformNodes } from '../src/utils/ast-utils';
|
|
12
|
+
import { gfmPlugin } from '../src/plugins/gfm';
|
|
13
|
+
import { commonmarkPlugin } from '../src/plugins/commonmark';
|
|
14
|
+
|
|
15
|
+
describe('MarkdownParser - Plugins', () => {
|
|
16
|
+
describe('Plugin system', () => {
|
|
17
|
+
it('should apply custom plugin', async () => {
|
|
18
|
+
const uppercasePlugin: MarkdownPlugin = {
|
|
19
|
+
name: 'uppercase',
|
|
20
|
+
version: '1.0.0',
|
|
21
|
+
transform: (ast) => {
|
|
22
|
+
return transformNodes(ast, (node) => {
|
|
23
|
+
if (node.type === 'text' && node.value) {
|
|
24
|
+
return { ...node, value: node.value.toUpperCase() };
|
|
25
|
+
}
|
|
26
|
+
return node;
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const parser = new MarkdownParser({ plugins: [uppercasePlugin] });
|
|
32
|
+
const result = await parser.parse('# hello world');
|
|
33
|
+
|
|
34
|
+
expect(result.success).toBe(true);
|
|
35
|
+
expect(result.ast!.children![0].children![0].value).toBe('HELLO WORLD');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it('should apply multiple plugins in order', async () => {
|
|
39
|
+
const uppercasePlugin: MarkdownPlugin = {
|
|
40
|
+
name: 'uppercase',
|
|
41
|
+
version: '1.0.0',
|
|
42
|
+
transform: (ast) => {
|
|
43
|
+
return transformNodes(ast, (node) => {
|
|
44
|
+
if (node.type === 'text' && node.value) {
|
|
45
|
+
return { ...node, value: node.value.toUpperCase() };
|
|
46
|
+
}
|
|
47
|
+
return node;
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const prefixPlugin: MarkdownPlugin = {
|
|
53
|
+
name: 'prefix',
|
|
54
|
+
version: '1.0.0',
|
|
55
|
+
transform: (ast) => {
|
|
56
|
+
return transformNodes(ast, (node) => {
|
|
57
|
+
if (node.type === 'text' && node.value) {
|
|
58
|
+
return { ...node, value: `[PREFIX] ${node.value}` };
|
|
59
|
+
}
|
|
60
|
+
return node;
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const parser = new MarkdownParser({ plugins: [uppercasePlugin, prefixPlugin] });
|
|
66
|
+
const result = await parser.parse('# test');
|
|
67
|
+
|
|
68
|
+
expect(result.success).toBe(true);
|
|
69
|
+
expect(result.ast!.children![0].children![0].value).toBe('[PREFIX] TEST');
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('should handle plugin that modifies structure', async () => {
|
|
73
|
+
const wrapperPlugin: MarkdownPlugin = {
|
|
74
|
+
name: 'wrapper',
|
|
75
|
+
version: '1.0.0',
|
|
76
|
+
transform: (ast) => {
|
|
77
|
+
return {
|
|
78
|
+
type: 'root',
|
|
79
|
+
children: [
|
|
80
|
+
{
|
|
81
|
+
type: 'blockquote',
|
|
82
|
+
children: ast.children || [],
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const parser = new MarkdownParser({ plugins: [wrapperPlugin] });
|
|
90
|
+
const result = await parser.parse('# Test');
|
|
91
|
+
|
|
92
|
+
expect(result.success).toBe(true);
|
|
93
|
+
expect(result.ast!.children![0].type).toBe('blockquote');
|
|
94
|
+
expect(result.ast!.children![0].children![0].type).toBe('heading');
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('should work without plugins', async () => {
|
|
98
|
+
const parser = new MarkdownParser({ plugins: [] });
|
|
99
|
+
const result = await parser.parse('# Test');
|
|
100
|
+
|
|
101
|
+
expect(result.success).toBe(true);
|
|
102
|
+
expect(result.ast!.children![0].children![0].value).toBe('Test');
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('should pass through when plugin returns same AST', async () => {
|
|
106
|
+
const noopPlugin: MarkdownPlugin = {
|
|
107
|
+
name: 'noop',
|
|
108
|
+
version: '1.0.0',
|
|
109
|
+
transform: (ast) => ast,
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const parser = new MarkdownParser({ plugins: [noopPlugin] });
|
|
113
|
+
const result = await parser.parse('# Test');
|
|
114
|
+
|
|
115
|
+
expect(result.success).toBe(true);
|
|
116
|
+
expect(result.ast!.children![0].children![0].value).toBe('Test');
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
describe('Plugin edge cases', () => {
|
|
121
|
+
it('should handle plugin that filters nodes', async () => {
|
|
122
|
+
const filterCodePlugin: MarkdownPlugin = {
|
|
123
|
+
name: 'filter-code',
|
|
124
|
+
version: '1.0.0',
|
|
125
|
+
transform: (ast) => {
|
|
126
|
+
return {
|
|
127
|
+
...ast,
|
|
128
|
+
children: ast.children?.filter((node) => node.type !== 'codeBlock'),
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const parser = new MarkdownParser({ plugins: [filterCodePlugin] });
|
|
134
|
+
const result = await parser.parse('# Heading\n\n```javascript\ncode\n```\n\nParagraph');
|
|
135
|
+
|
|
136
|
+
expect(result.success).toBe(true);
|
|
137
|
+
expect(result.ast!.children).toHaveLength(2); // Heading and paragraph, no code
|
|
138
|
+
expect(result.ast!.children!.every((node) => node.type !== 'codeBlock')).toBe(true);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('should handle plugin that adds attributes', async () => {
|
|
142
|
+
const addIdPlugin: MarkdownPlugin = {
|
|
143
|
+
name: 'add-id',
|
|
144
|
+
version: '1.0.0',
|
|
145
|
+
transform: (ast) => {
|
|
146
|
+
return transformNodes(ast, (node) => {
|
|
147
|
+
if (node.type === 'heading') {
|
|
148
|
+
return {
|
|
149
|
+
...node,
|
|
150
|
+
attributes: {
|
|
151
|
+
...node.attributes,
|
|
152
|
+
id: `heading-${Math.random().toString(36).substring(7)}`,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
return node;
|
|
157
|
+
});
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const parser = new MarkdownParser({ plugins: [addIdPlugin] });
|
|
162
|
+
const result = await parser.parse('# Test Heading');
|
|
163
|
+
|
|
164
|
+
expect(result.success).toBe(true);
|
|
165
|
+
expect(result.ast!.children![0].attributes).toHaveProperty('id');
|
|
166
|
+
expect(result.ast!.children![0].attributes!.level).toBe(1);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('should handle plugin that counts nodes', async () => {
|
|
170
|
+
let nodeCount = 0;
|
|
171
|
+
|
|
172
|
+
const countPlugin: MarkdownPlugin = {
|
|
173
|
+
name: 'counter',
|
|
174
|
+
version: '1.0.0',
|
|
175
|
+
transform: (ast) => {
|
|
176
|
+
nodeCount = 0;
|
|
177
|
+
transformNodes(ast, (node) => {
|
|
178
|
+
nodeCount++;
|
|
179
|
+
return node;
|
|
180
|
+
});
|
|
181
|
+
return ast;
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
const parser = new MarkdownParser({ plugins: [countPlugin] });
|
|
186
|
+
await parser.parse('# Heading\n\nParagraph with **bold** text');
|
|
187
|
+
|
|
188
|
+
expect(nodeCount).toBeGreaterThan(0);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('should work with plugins and caching', async () => {
|
|
192
|
+
const uppercasePlugin: MarkdownPlugin = {
|
|
193
|
+
name: 'uppercase',
|
|
194
|
+
version: '1.0.0',
|
|
195
|
+
transform: (ast) => {
|
|
196
|
+
return transformNodes(ast, (node) => {
|
|
197
|
+
if (node.type === 'text' && node.value) {
|
|
198
|
+
return { ...node, value: node.value.toUpperCase() };
|
|
199
|
+
}
|
|
200
|
+
return node;
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
const parser = new MarkdownParser({
|
|
206
|
+
plugins: [uppercasePlugin],
|
|
207
|
+
cache: { enabled: true },
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
const result1 = await parser.parse('# test');
|
|
211
|
+
const result2 = await parser.parse('# test');
|
|
212
|
+
|
|
213
|
+
expect(result1.ast!.children![0].children![0].value).toBe('TEST');
|
|
214
|
+
expect(result2.ast!.children![0].children![0].value).toBe('TEST');
|
|
215
|
+
expect(result2.metadata!.cached).toBe(true);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
describe('Built-in plugins', () => {
|
|
220
|
+
it('should export gfm plugin', () => {
|
|
221
|
+
expect(gfmPlugin).toBeDefined();
|
|
222
|
+
expect(gfmPlugin.name).toBe('gfm');
|
|
223
|
+
expect(gfmPlugin.version).toBeDefined();
|
|
224
|
+
expect(typeof gfmPlugin.transform).toBe('function');
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
it('should export commonmark plugin', () => {
|
|
228
|
+
expect(commonmarkPlugin).toBeDefined();
|
|
229
|
+
expect(commonmarkPlugin.name).toBe('commonmark');
|
|
230
|
+
expect(commonmarkPlugin.version).toBeDefined();
|
|
231
|
+
expect(typeof commonmarkPlugin.transform).toBe('function');
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it('should use gfm plugin transform function', async () => {
|
|
235
|
+
const testAst = {
|
|
236
|
+
type: 'root' as const,
|
|
237
|
+
children: [{ type: 'paragraph' as const, children: [{ type: 'text' as const, value: 'test' }] }],
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const result = gfmPlugin.transform(testAst);
|
|
241
|
+
|
|
242
|
+
// GFM plugin is a passthrough by default (features built into parser)
|
|
243
|
+
expect(result).toEqual(testAst);
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
it('should use commonmark plugin transform function', async () => {
|
|
247
|
+
const testAst = {
|
|
248
|
+
type: 'root' as const,
|
|
249
|
+
children: [{ type: 'paragraph' as const, children: [{ type: 'text' as const, value: 'test' }] }],
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
const result = commonmarkPlugin.transform(testAst);
|
|
253
|
+
|
|
254
|
+
// CommonMark plugin is a passthrough by default (features built into parser)
|
|
255
|
+
expect(result).toEqual(testAst);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
it('should use gfm plugin in parser', async () => {
|
|
259
|
+
const parser = new MarkdownParser({
|
|
260
|
+
gfm: true,
|
|
261
|
+
plugins: [gfmPlugin],
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
const result = await parser.parse('# Test');
|
|
265
|
+
|
|
266
|
+
expect(result.success).toBe(true);
|
|
267
|
+
expect(result.ast!.children![0].type).toBe('heading');
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
it('should use commonmark plugin in parser', async () => {
|
|
271
|
+
const parser = new MarkdownParser({
|
|
272
|
+
commonmark: true,
|
|
273
|
+
plugins: [commonmarkPlugin],
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
const result = await parser.parse('# Test');
|
|
277
|
+
|
|
278
|
+
expect(result.success).toBe(true);
|
|
279
|
+
expect(result.ast!.children![0].type).toBe('heading');
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
});
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<coverage generated="1762366231201" clover="3.2.0">
|
|
3
|
+
<project timestamp="1762366231201" name="All files">
|
|
4
|
+
<metrics statements="250" coveredstatements="244" conditionals="91" coveredconditionals="87" methods="31" coveredmethods="30" elements="372" coveredelements="361" complexity="0" loc="250" ncloc="250" packages="3" files="6" classes="6"/>
|
|
5
|
+
<package name="src">
|
|
6
|
+
<metrics statements="188" coveredstatements="185" conditionals="74" coveredconditionals="72" methods="15" coveredmethods="15"/>
|
|
7
|
+
<file name="MarkdownParser.ts" path="/Users/mattbernier/projects/tools/packages/core/markdown-parser/src/MarkdownParser.ts">
|
|
8
|
+
<metrics statements="188" coveredstatements="185" conditionals="74" coveredconditionals="72" methods="15" coveredmethods="15"/>
|
|
9
|
+
<line num="11" count="3" type="stmt"/>
|
|
10
|
+
<line num="12" count="3" type="stmt"/>
|
|
11
|
+
<line num="17" count="3" type="stmt"/>
|
|
12
|
+
<line num="23" count="100" type="stmt"/>
|
|
13
|
+
<line num="35" count="100" type="cond" truecount="2" falsecount="0"/>
|
|
14
|
+
<line num="39" count="100" type="stmt"/>
|
|
15
|
+
<line num="46" count="222" type="stmt"/>
|
|
16
|
+
<line num="49" count="222" type="cond" truecount="1" falsecount="0"/>
|
|
17
|
+
<line num="50" count="144" type="stmt"/>
|
|
18
|
+
<line num="51" count="144" type="stmt"/>
|
|
19
|
+
<line num="53" count="144" type="cond" truecount="1" falsecount="0"/>
|
|
20
|
+
<line num="54" count="10" type="stmt"/>
|
|
21
|
+
<line num="55" count="10" type="stmt"/>
|
|
22
|
+
<line num="67" count="212" type="stmt"/>
|
|
23
|
+
<line num="69" count="212" type="stmt"/>
|
|
24
|
+
<line num="72" count="210" type="stmt"/>
|
|
25
|
+
<line num="73" count="11" type="stmt"/>
|
|
26
|
+
<line num="77" count="210" type="cond" truecount="1" falsecount="0"/>
|
|
27
|
+
<line num="78" count="134" type="stmt"/>
|
|
28
|
+
<line num="79" count="134" type="stmt"/>
|
|
29
|
+
<line num="82" count="210" type="stmt"/>
|
|
30
|
+
<line num="83" count="210" type="stmt"/>
|
|
31
|
+
<line num="88" count="210" type="stmt"/>
|
|
32
|
+
<line num="98" count="2" type="cond" truecount="2" falsecount="0"/>
|
|
33
|
+
<line num="99" count="2" type="stmt"/>
|
|
34
|
+
<line num="100" count="2" type="stmt"/>
|
|
35
|
+
<line num="111" count="214" type="stmt"/>
|
|
36
|
+
<line num="112" count="214" type="stmt"/>
|
|
37
|
+
<line num="114" count="214" type="stmt"/>
|
|
38
|
+
<line num="115" count="214" type="stmt"/>
|
|
39
|
+
<line num="117" count="214" type="stmt"/>
|
|
40
|
+
<line num="118" count="2245" type="stmt"/>
|
|
41
|
+
<line num="119" count="2245" type="stmt"/>
|
|
42
|
+
<line num="122" count="2245" type="cond" truecount="1" falsecount="0"/>
|
|
43
|
+
<line num="123" count="1014" type="stmt"/>
|
|
44
|
+
<line num="124" count="1014" type="stmt"/>
|
|
45
|
+
<line num="128" count="1231" type="stmt"/>
|
|
46
|
+
<line num="129" count="1231" type="cond" truecount="1" falsecount="0"/>
|
|
47
|
+
<line num="130" count="1160" type="stmt"/>
|
|
48
|
+
<line num="131" count="1160" type="stmt"/>
|
|
49
|
+
<line num="132" count="1160" type="stmt"/>
|
|
50
|
+
<line num="138" count="1160" type="stmt"/>
|
|
51
|
+
<line num="139" count="1160" type="stmt"/>
|
|
52
|
+
<line num="143" count="71" type="cond" truecount="1" falsecount="0"/>
|
|
53
|
+
<line num="144" count="4" type="stmt"/>
|
|
54
|
+
<line num="148" count="4" type="stmt"/>
|
|
55
|
+
<line num="149" count="4" type="stmt"/>
|
|
56
|
+
<line num="153" count="67" type="cond" truecount="1" falsecount="0"/>
|
|
57
|
+
<line num="154" count="6" type="stmt"/>
|
|
58
|
+
<line num="155" count="6" type="stmt"/>
|
|
59
|
+
<line num="156" count="6" type="stmt"/>
|
|
60
|
+
<line num="157" count="6" type="stmt"/>
|
|
61
|
+
<line num="159" count="6" type="cond" truecount="2" falsecount="0"/>
|
|
62
|
+
<line num="160" count="7" type="stmt"/>
|
|
63
|
+
<line num="161" count="7" type="stmt"/>
|
|
64
|
+
<line num="164" count="6" type="stmt"/>
|
|
65
|
+
<line num="170" count="6" type="stmt"/>
|
|
66
|
+
<line num="171" count="6" type="stmt"/>
|
|
67
|
+
<line num="175" count="61" type="cond" truecount="1" falsecount="0"/>
|
|
68
|
+
<line num="176" count="4" type="stmt"/>
|
|
69
|
+
<line num="177" count="4" type="stmt"/>
|
|
70
|
+
<line num="179" count="4" type="cond" truecount="2" falsecount="0"/>
|
|
71
|
+
<line num="180" count="6" type="stmt"/>
|
|
72
|
+
<line num="181" count="6" type="stmt"/>
|
|
73
|
+
<line num="184" count="4" type="stmt"/>
|
|
74
|
+
<line num="185" count="4" type="stmt"/>
|
|
75
|
+
<line num="187" count="4" type="stmt"/>
|
|
76
|
+
<line num="192" count="4" type="stmt"/>
|
|
77
|
+
<line num="196" count="57" type="cond" truecount="3" falsecount="0"/>
|
|
78
|
+
<line num="197" count="6" type="cond" truecount="2" falsecount="0"/>
|
|
79
|
+
<line num="198" count="6" type="stmt"/>
|
|
80
|
+
<line num="199" count="6" type="stmt"/>
|
|
81
|
+
<line num="205" count="6" type="stmt"/>
|
|
82
|
+
<line num="206" count="6" type="stmt"/>
|
|
83
|
+
<line num="210" count="51" type="cond" truecount="1" falsecount="0"/>
|
|
84
|
+
<line num="211" count="6" type="stmt"/>
|
|
85
|
+
<line num="212" count="6" type="stmt"/>
|
|
86
|
+
<line num="214" count="6" type="cond" truecount="2" falsecount="0"/>
|
|
87
|
+
<line num="215" count="11" type="stmt"/>
|
|
88
|
+
<line num="216" count="11" type="stmt"/>
|
|
89
|
+
<line num="220" count="11" type="stmt"/>
|
|
90
|
+
<line num="223" count="6" type="stmt"/>
|
|
91
|
+
<line num="229" count="6" type="stmt"/>
|
|
92
|
+
<line num="233" count="45" type="cond" truecount="1" falsecount="0"/>
|
|
93
|
+
<line num="234" count="1" type="stmt"/>
|
|
94
|
+
<line num="235" count="1" type="stmt"/>
|
|
95
|
+
<line num="237" count="1" type="cond" truecount="2" falsecount="0"/>
|
|
96
|
+
<line num="238" count="3" type="stmt"/>
|
|
97
|
+
<line num="239" count="3" type="stmt"/>
|
|
98
|
+
<line num="243" count="3" type="stmt"/>
|
|
99
|
+
<line num="246" count="1" type="stmt"/>
|
|
100
|
+
<line num="252" count="1" type="stmt"/>
|
|
101
|
+
<line num="256" count="44" type="cond" truecount="4" falsecount="0"/>
|
|
102
|
+
<line num="257" count="8" type="stmt"/>
|
|
103
|
+
<line num="258" count="8" type="stmt"/>
|
|
104
|
+
<line num="259" count="8" type="stmt"/>
|
|
105
|
+
<line num="260" count="8" type="stmt"/>
|
|
106
|
+
<line num="264" count="36" type="stmt"/>
|
|
107
|
+
<line num="265" count="36" type="stmt"/>
|
|
108
|
+
<line num="266" count="36" type="stmt"/>
|
|
109
|
+
<line num="269" count="36" type="stmt"/>
|
|
110
|
+
<line num="274" count="7" type="stmt"/>
|
|
111
|
+
<line num="275" count="7" type="stmt"/>
|
|
112
|
+
<line num="278" count="36" type="stmt"/>
|
|
113
|
+
<line num="279" count="36" type="stmt"/>
|
|
114
|
+
<line num="286" count="214" type="stmt"/>
|
|
115
|
+
<line num="293" count="1246" type="stmt"/>
|
|
116
|
+
<line num="294" count="1246" type="stmt"/>
|
|
117
|
+
<line num="296" count="1246" type="stmt"/>
|
|
118
|
+
<line num="298" count="1283" type="stmt"/>
|
|
119
|
+
<line num="299" count="1283" type="cond" truecount="1" falsecount="0"/>
|
|
120
|
+
<line num="300" count="5" type="stmt"/>
|
|
121
|
+
<line num="304" count="5" type="stmt"/>
|
|
122
|
+
<line num="305" count="5" type="stmt"/>
|
|
123
|
+
<line num="309" count="1278" type="stmt"/>
|
|
124
|
+
<line num="310" count="1278" type="cond" truecount="1" falsecount="0"/>
|
|
125
|
+
<line num="311" count="3" type="stmt"/>
|
|
126
|
+
<line num="315" count="3" type="stmt"/>
|
|
127
|
+
<line num="316" count="3" type="stmt"/>
|
|
128
|
+
<line num="320" count="1275" type="stmt"/>
|
|
129
|
+
<line num="321" count="1275" type="cond" truecount="1" falsecount="0"/>
|
|
130
|
+
<line num="322" count="1" type="stmt"/>
|
|
131
|
+
<line num="326" count="1" type="stmt"/>
|
|
132
|
+
<line num="327" count="1" type="stmt"/>
|
|
133
|
+
<line num="331" count="1274" type="cond" truecount="1" falsecount="0"/>
|
|
134
|
+
<line num="332" count="1261" type="stmt"/>
|
|
135
|
+
<line num="333" count="1261" type="cond" truecount="1" falsecount="0"/>
|
|
136
|
+
<line num="334" count="1" type="stmt"/>
|
|
137
|
+
<line num="338" count="1" type="stmt"/>
|
|
138
|
+
<line num="339" count="1" type="stmt"/>
|
|
139
|
+
<line num="344" count="1273" type="stmt"/>
|
|
140
|
+
<line num="345" count="1273" type="cond" truecount="1" falsecount="0"/>
|
|
141
|
+
<line num="346" count="2" type="stmt"/>
|
|
142
|
+
<line num="353" count="2" type="stmt"/>
|
|
143
|
+
<line num="354" count="2" type="stmt"/>
|
|
144
|
+
<line num="358" count="1271" type="stmt"/>
|
|
145
|
+
<line num="359" count="1271" type="cond" truecount="1" falsecount="0"/>
|
|
146
|
+
<line num="360" count="1" type="stmt"/>
|
|
147
|
+
<line num="367" count="1" type="stmt"/>
|
|
148
|
+
<line num="368" count="1" type="stmt"/>
|
|
149
|
+
<line num="372" count="1270" type="cond" truecount="1" falsecount="0"/>
|
|
150
|
+
<line num="373" count="1257" type="stmt"/>
|
|
151
|
+
<line num="374" count="1257" type="cond" truecount="1" falsecount="0"/>
|
|
152
|
+
<line num="375" count="1" type="stmt"/>
|
|
153
|
+
<line num="382" count="1" type="stmt"/>
|
|
154
|
+
<line num="383" count="1" type="stmt"/>
|
|
155
|
+
<line num="388" count="1269" type="cond" truecount="0" falsecount="1"/>
|
|
156
|
+
<line num="389" count="0" type="stmt"/>
|
|
157
|
+
<line num="390" count="0" type="stmt"/>
|
|
158
|
+
<line num="391" count="0" type="stmt"/>
|
|
159
|
+
<line num="395" count="1269" type="stmt"/>
|
|
160
|
+
<line num="396" count="1269" type="cond" truecount="1" falsecount="0"/>
|
|
161
|
+
<line num="397" count="1259" type="stmt"/>
|
|
162
|
+
<line num="401" count="1259" type="stmt"/>
|
|
163
|
+
<line num="402" count="1259" type="stmt"/>
|
|
164
|
+
<line num="406" count="10" type="stmt"/>
|
|
165
|
+
<line num="410" count="10" type="stmt"/>
|
|
166
|
+
<line num="413" count="1246" type="stmt"/>
|
|
167
|
+
<line num="420" count="8" type="stmt"/>
|
|
168
|
+
<line num="421" count="8" type="stmt"/>
|
|
169
|
+
<line num="424" count="29" type="stmt"/>
|
|
170
|
+
<line num="425" count="8" type="stmt"/>
|
|
171
|
+
<line num="427" count="13" type="stmt"/>
|
|
172
|
+
<line num="435" count="8" type="stmt"/>
|
|
173
|
+
<line num="437" count="29" type="stmt"/>
|
|
174
|
+
<line num="439" count="13" type="stmt"/>
|
|
175
|
+
<line num="440" count="13" type="cond" truecount="3" falsecount="0"/>
|
|
176
|
+
<line num="441" count="12" type="cond" truecount="1" falsecount="0"/>
|
|
177
|
+
<line num="442" count="11" type="cond" truecount="1" falsecount="0"/>
|
|
178
|
+
<line num="443" count="9" type="stmt"/>
|
|
179
|
+
<line num="447" count="8" type="stmt"/>
|
|
180
|
+
<line num="448" count="8" type="stmt"/>
|
|
181
|
+
<line num="450" count="8" type="cond" truecount="2" falsecount="0"/>
|
|
182
|
+
<line num="451" count="37" type="stmt"/>
|
|
183
|
+
<line num="452" count="10" type="stmt"/>
|
|
184
|
+
<line num="454" count="17" type="stmt"/>
|
|
185
|
+
<line num="463" count="10" type="stmt"/>
|
|
186
|
+
<line num="466" count="8" type="stmt"/>
|
|
187
|
+
<line num="480" count="1231" type="stmt"/>
|
|
188
|
+
<line num="490" count="3" type="cond" truecount="1" falsecount="0"/>
|
|
189
|
+
<line num="491" count="2" type="stmt"/>
|
|
190
|
+
<line num="492" count="2" type="stmt"/>
|
|
191
|
+
<line num="500" count="13" type="stmt"/>
|
|
192
|
+
<line num="510" count="4" type="cond" truecount="1" falsecount="0"/>
|
|
193
|
+
<line num="511" count="3" type="stmt"/>
|
|
194
|
+
<line num="512" count="3" type="stmt"/>
|
|
195
|
+
<line num="513" count="3" type="stmt"/>
|
|
196
|
+
<line num="515" count="1" type="stmt"/>
|
|
197
|
+
</file>
|
|
198
|
+
</package>
|
|
199
|
+
<package name="src.plugins">
|
|
200
|
+
<metrics statements="6" coveredstatements="4" conditionals="0" coveredconditionals="0" methods="2" coveredmethods="2"/>
|
|
201
|
+
<file name="commonmark.ts" path="/Users/mattbernier/projects/tools/packages/core/markdown-parser/src/plugins/commonmark.ts">
|
|
202
|
+
<metrics statements="2" coveredstatements="2" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
|
|
203
|
+
<line num="14" count="1" type="stmt"/>
|
|
204
|
+
<line num="21" count="2" type="stmt"/>
|
|
205
|
+
</file>
|
|
206
|
+
<file name="gfm.ts" path="/Users/mattbernier/projects/tools/packages/core/markdown-parser/src/plugins/gfm.ts">
|
|
207
|
+
<metrics statements="2" coveredstatements="2" conditionals="0" coveredconditionals="0" methods="1" coveredmethods="1"/>
|
|
208
|
+
<line num="14" count="1" type="stmt"/>
|
|
209
|
+
<line num="21" count="2" type="stmt"/>
|
|
210
|
+
</file>
|
|
211
|
+
<file name="index.ts" path="/Users/mattbernier/projects/tools/packages/core/markdown-parser/src/plugins/index.ts">
|
|
212
|
+
<metrics statements="2" coveredstatements="0" conditionals="0" coveredconditionals="0" methods="0" coveredmethods="0"/>
|
|
213
|
+
<line num="9" count="0" type="stmt"/>
|
|
214
|
+
<line num="10" count="0" type="stmt"/>
|
|
215
|
+
</file>
|
|
216
|
+
</package>
|
|
217
|
+
<package name="src.utils">
|
|
218
|
+
<metrics statements="56" coveredstatements="55" conditionals="17" coveredconditionals="15" methods="14" coveredmethods="13"/>
|
|
219
|
+
<file name="ast-utils.ts" path="/Users/mattbernier/projects/tools/packages/core/markdown-parser/src/utils/ast-utils.ts">
|
|
220
|
+
<metrics statements="27" coveredstatements="27" conditionals="11" coveredconditionals="11" methods="6" coveredmethods="6"/>
|
|
221
|
+
<line num="14" count="4" type="stmt"/>
|
|
222
|
+
<line num="15" count="7670" type="stmt"/>
|
|
223
|
+
<line num="16" count="7670" type="cond" truecount="1" falsecount="0"/>
|
|
224
|
+
<line num="17" count="4054" type="stmt"/>
|
|
225
|
+
<line num="18" count="7231" type="stmt"/>
|
|
226
|
+
<line num="21" count="7670" type="stmt"/>
|
|
227
|
+
<line num="27" count="4" type="stmt"/>
|
|
228
|
+
<line num="28" count="22" type="stmt"/>
|
|
229
|
+
<line num="29" count="22" type="cond" truecount="1" falsecount="0"/>
|
|
230
|
+
<line num="30" count="11" type="stmt"/>
|
|
231
|
+
<line num="31" count="18" type="stmt"/>
|
|
232
|
+
<line num="39" count="4" type="stmt"/>
|
|
233
|
+
<line num="40" count="63" type="stmt"/>
|
|
234
|
+
<line num="41" count="63" type="cond" truecount="1" falsecount="0"/>
|
|
235
|
+
<line num="42" count="34" type="stmt"/>
|
|
236
|
+
<line num="44" count="52" type="stmt"/>
|
|
237
|
+
<line num="47" count="29" type="stmt"/>
|
|
238
|
+
<line num="53" count="4" type="stmt"/>
|
|
239
|
+
<line num="54" count="79" type="stmt"/>
|
|
240
|
+
<line num="55" count="79" type="cond" truecount="1" falsecount="0"/>
|
|
241
|
+
<line num="56" count="21" type="stmt"/>
|
|
242
|
+
<line num="58" count="79" type="cond" truecount="1" falsecount="0"/>
|
|
243
|
+
<line num="59" count="41" type="stmt"/>
|
|
244
|
+
<line num="60" count="69" type="stmt"/>
|
|
245
|
+
<line num="63" count="79" type="stmt"/>
|
|
246
|
+
<line num="69" count="4" type="stmt"/>
|
|
247
|
+
<line num="70" count="36" type="stmt"/>
|
|
248
|
+
</file>
|
|
249
|
+
<file name="cache.ts" path="/Users/mattbernier/projects/tools/packages/core/markdown-parser/src/utils/cache.ts">
|
|
250
|
+
<metrics statements="29" coveredstatements="28" conditionals="6" coveredconditionals="4" methods="8" coveredmethods="7"/>
|
|
251
|
+
<line num="10" count="3" type="stmt"/>
|
|
252
|
+
<line num="15" count="3" type="stmt"/>
|
|
253
|
+
<line num="21" count="20" type="stmt"/>
|
|
254
|
+
<line num="22" count="20" type="stmt"/>
|
|
255
|
+
<line num="23" count="20" type="stmt"/>
|
|
256
|
+
<line num="30" count="278" type="stmt"/>
|
|
257
|
+
<line num="37" count="144" type="stmt"/>
|
|
258
|
+
<line num="38" count="144" type="cond" truecount="1" falsecount="0"/>
|
|
259
|
+
<line num="39" count="133" type="stmt"/>
|
|
260
|
+
<line num="43" count="11" type="stmt"/>
|
|
261
|
+
<line num="44" count="11" type="cond" truecount="1" falsecount="0"/>
|
|
262
|
+
<line num="45" count="1" type="stmt"/>
|
|
263
|
+
<line num="46" count="1" type="stmt"/>
|
|
264
|
+
<line num="49" count="10" type="stmt"/>
|
|
265
|
+
<line num="57" count="134" type="cond" truecount="1" falsecount="0"/>
|
|
266
|
+
<line num="58" count="2" type="stmt"/>
|
|
267
|
+
<line num="59" count="2" type="stmt"/>
|
|
268
|
+
<line num="62" count="134" type="stmt"/>
|
|
269
|
+
<line num="72" count="0" type="stmt"/>
|
|
270
|
+
<line num="79" count="2" type="stmt"/>
|
|
271
|
+
<line num="86" count="12" type="stmt"/>
|
|
272
|
+
<line num="93" count="3" type="stmt"/>
|
|
273
|
+
<line num="94" count="3" type="stmt"/>
|
|
274
|
+
<line num="96" count="3" type="stmt"/>
|
|
275
|
+
<line num="97" count="7" type="stmt"/>
|
|
276
|
+
<line num="98" count="7" type="cond" truecount="1" falsecount="0"/>
|
|
277
|
+
<line num="99" count="6" type="stmt"/>
|
|
278
|
+
<line num="100" count="6" type="stmt"/>
|
|
279
|
+
<line num="104" count="3" type="stmt"/>
|
|
280
|
+
</file>
|
|
281
|
+
</package>
|
|
282
|
+
</project>
|
|
283
|
+
</coverage>
|