@podlite/markdown 0.0.5 → 0.0.7
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/CHANGELOG.md +18 -0
- package/README.md +31 -5
- package/index.js +1 -1
- package/jest.config.js +0 -1
- package/jest.tsconfig.json +1 -1
- package/lib/index.cjs +40 -0
- package/lib/index.cjs.map +7 -0
- package/lib/index.esm.js +31184 -0
- package/lib/index.esm.js.map +7 -0
- package/package.json +13 -12
- package/scripts/build.ts +6 -6
- package/scripts/build_esm.ts +12 -9
- package/src/index.tsx +21 -24
- package/src/tools.ts +180 -135
- package/t/parse.test.ts +120 -123
- package/t/plugin.test.tsx +48 -57
- package/tsconfig-esm.json +6 -0
- package/tsconfig.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/esm/index.d.ts +0 -6
- package/esm/index.js +0 -39
- package/esm/index.js.map +0 -7
- package/esm/tools.d.ts +0 -6
- package/lib/index.js +0 -40
- package/lib/index.js.map +0 -7
package/t/parse.test.ts
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import { isValidateError } from
|
|
2
|
-
import { validateAstTree } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { md2ast } from "../src/tools";
|
|
6
|
-
import { podlite as podlite_core } from "podlite";
|
|
7
|
-
import { PodliteDocument } from "@podlite/schema";
|
|
1
|
+
import { frozenIds, isValidateError, podlitePluggable } from '@podlite/schema'
|
|
2
|
+
import { validateAstTree } from '@podlite/schema'
|
|
3
|
+
import { md2ast } from '../src/tools'
|
|
4
|
+
import { PodliteDocument } from '@podlite/schema'
|
|
8
5
|
|
|
9
|
-
const process =
|
|
10
|
-
return frozenIds()(md2ast(src))
|
|
11
|
-
}
|
|
6
|
+
const process = src => {
|
|
7
|
+
return frozenIds()(md2ast(src))
|
|
8
|
+
}
|
|
12
9
|
|
|
13
10
|
export const parse = (str: string): PodliteDocument => {
|
|
14
|
-
let podlite =
|
|
15
|
-
let tree = podlite.parse(str)
|
|
16
|
-
const asAst = podlite.toAstResult(tree)
|
|
17
|
-
return asAst.interator
|
|
18
|
-
}
|
|
19
|
-
it(
|
|
20
|
-
const pod = `text
|
|
11
|
+
let podlite = podlitePluggable().use({})
|
|
12
|
+
let tree = podlite.parse(str)
|
|
13
|
+
const asAst = podlite.toAstResult(tree)
|
|
14
|
+
return asAst.interator
|
|
15
|
+
}
|
|
16
|
+
it('=markdown: parse para', () => {
|
|
17
|
+
const pod = `text`
|
|
21
18
|
// const tree1 = parse(pod);
|
|
22
|
-
const tree = process(pod)
|
|
23
|
-
const r = validateAstTree([tree])
|
|
24
|
-
expect(r).toEqual([])
|
|
25
|
-
const errorDescribe = isValidateError(r, tree)
|
|
19
|
+
const tree = process(pod)
|
|
20
|
+
const r = validateAstTree([tree])
|
|
21
|
+
expect(r).toEqual([])
|
|
22
|
+
const errorDescribe = isValidateError(r, tree)
|
|
26
23
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
27
24
|
Object {
|
|
28
25
|
"content": Array [
|
|
@@ -53,29 +50,29 @@ it("=Markdown: parse para", () => {
|
|
|
53
50
|
"name": "root",
|
|
54
51
|
"type": "block",
|
|
55
52
|
}
|
|
56
|
-
`)
|
|
57
|
-
})
|
|
53
|
+
`)
|
|
54
|
+
})
|
|
58
55
|
|
|
59
|
-
it.skip(
|
|
60
|
-
const pod = `text
|
|
61
|
-
const tree = process(pod)
|
|
56
|
+
it.skip('[markdown]: parse para', () => {
|
|
57
|
+
const pod = `text`
|
|
58
|
+
const tree = process(pod)
|
|
62
59
|
// console.log(JSON.stringify(tree, null, 2));
|
|
63
60
|
// console.log(JSON.stringify(parse(`L<https://uerl>`), null, 2));
|
|
64
|
-
const r = validateAstTree([tree])
|
|
65
|
-
expect(r).toEqual([])
|
|
66
|
-
const errorDescribe = isValidateError(r, tree)
|
|
61
|
+
const r = validateAstTree([tree])
|
|
62
|
+
expect(r).toEqual([])
|
|
63
|
+
const errorDescribe = isValidateError(r, tree)
|
|
67
64
|
// expect(process(pod)).toMatchInlineSnapshot();
|
|
68
|
-
})
|
|
65
|
+
})
|
|
69
66
|
|
|
70
|
-
it(
|
|
67
|
+
it('[markdown]: parse headers', () => {
|
|
71
68
|
const pod = `## build
|
|
72
69
|
|
|
73
70
|
Generate JavaScript documentation as a list of parsed JSDoc
|
|
74
|
-
comments, given a root file as a path
|
|
75
|
-
const tree = process(pod)
|
|
76
|
-
const r = validateAstTree([tree])
|
|
77
|
-
expect(r).toEqual([])
|
|
78
|
-
const errorDescribe = isValidateError(r, tree)
|
|
71
|
+
comments, given a root file as a path`
|
|
72
|
+
const tree = process(pod)
|
|
73
|
+
const r = validateAstTree([tree])
|
|
74
|
+
expect(r).toEqual([])
|
|
75
|
+
const errorDescribe = isValidateError(r, tree)
|
|
79
76
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
80
77
|
Object {
|
|
81
78
|
"content": Array [
|
|
@@ -129,14 +126,14 @@ comments, given a root file as a path`;
|
|
|
129
126
|
"name": "root",
|
|
130
127
|
"type": "block",
|
|
131
128
|
}
|
|
132
|
-
`)
|
|
133
|
-
})
|
|
134
|
-
it(
|
|
135
|
-
const pod = `[#raku IRC channel](https://raku.org/community/irc)
|
|
136
|
-
const tree = process(pod)
|
|
137
|
-
const r = validateAstTree([tree])
|
|
138
|
-
expect(r).toEqual([])
|
|
139
|
-
const errorDescribe = isValidateError(r, tree)
|
|
129
|
+
`)
|
|
130
|
+
})
|
|
131
|
+
it('[markdown]: parse link', () => {
|
|
132
|
+
const pod = `[#raku IRC channel](https://raku.org/community/irc)`
|
|
133
|
+
const tree = process(pod)
|
|
134
|
+
const r = validateAstTree([tree])
|
|
135
|
+
expect(r).toEqual([])
|
|
136
|
+
const errorDescribe = isValidateError(r, tree)
|
|
140
137
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
141
138
|
Object {
|
|
142
139
|
"content": Array [
|
|
@@ -174,14 +171,14 @@ it("[markdown]: parse link", () => {
|
|
|
174
171
|
"name": "root",
|
|
175
172
|
"type": "block",
|
|
176
173
|
}
|
|
177
|
-
`)
|
|
178
|
-
})
|
|
179
|
-
it(
|
|
180
|
-
const pod = `
|
|
181
|
-
const tree = process(pod)
|
|
182
|
-
const r = validateAstTree([tree])
|
|
183
|
-
expect(r).toEqual([])
|
|
184
|
-
const errorDescribe = isValidateError(r, tree)
|
|
174
|
+
`)
|
|
175
|
+
})
|
|
176
|
+
it('[markdown]: parse image', () => {
|
|
177
|
+
const pod = ``
|
|
178
|
+
const tree = process(pod)
|
|
179
|
+
const r = validateAstTree([tree])
|
|
180
|
+
expect(r).toEqual([])
|
|
181
|
+
const errorDescribe = isValidateError(r, tree)
|
|
185
182
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
186
183
|
Object {
|
|
187
184
|
"content": Array [
|
|
@@ -244,10 +241,10 @@ it("[markdown]: parse image", () => {
|
|
|
244
241
|
"name": "root",
|
|
245
242
|
"type": "block",
|
|
246
243
|
}
|
|
247
|
-
`)
|
|
248
|
-
})
|
|
244
|
+
`)
|
|
245
|
+
})
|
|
249
246
|
|
|
250
|
-
it(
|
|
247
|
+
it('[markdown]: parse refs', () => {
|
|
251
248
|
const pod = `### Table of Contents
|
|
252
249
|
|
|
253
250
|
- [lint][1]
|
|
@@ -256,11 +253,11 @@ it("[markdown]: parse refs", () => {
|
|
|
256
253
|
|
|
257
254
|
[1]: #lint
|
|
258
255
|
|
|
259
|
-
[2]: #parameters
|
|
260
|
-
const tree = process(pod)
|
|
261
|
-
const r = validateAstTree([tree])
|
|
262
|
-
expect(r).toEqual([])
|
|
263
|
-
const errorDescribe = isValidateError(r, tree)
|
|
256
|
+
[2]: #parameters`
|
|
257
|
+
const tree = process(pod)
|
|
258
|
+
const r = validateAstTree([tree])
|
|
259
|
+
expect(r).toEqual([])
|
|
260
|
+
const errorDescribe = isValidateError(r, tree)
|
|
264
261
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
265
262
|
Object {
|
|
266
263
|
"content": Array [
|
|
@@ -408,19 +405,19 @@ it("[markdown]: parse refs", () => {
|
|
|
408
405
|
"name": "root",
|
|
409
406
|
"type": "block",
|
|
410
407
|
}
|
|
411
|
-
`)
|
|
412
|
-
})
|
|
408
|
+
`)
|
|
409
|
+
})
|
|
413
410
|
|
|
414
|
-
it(
|
|
411
|
+
it('[markdown]: broken_refs', () => {
|
|
415
412
|
const pod = `### Parameters
|
|
416
413
|
|
|
417
414
|
- \`comments\` **[Array][17]<[Object][19]>** parsed comments
|
|
418
415
|
- \`args\` **[Object][19]** Options that can customize the output
|
|
419
|
-
|
|
420
|
-
const tree = process(pod)
|
|
421
|
-
const r = validateAstTree([tree])
|
|
422
|
-
expect(r).toEqual([])
|
|
423
|
-
const errorDescribe = isValidateError(r, tree)
|
|
416
|
+
`
|
|
417
|
+
const tree = process(pod)
|
|
418
|
+
const r = validateAstTree([tree])
|
|
419
|
+
expect(r).toEqual([])
|
|
420
|
+
const errorDescribe = isValidateError(r, tree)
|
|
424
421
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
425
422
|
Object {
|
|
426
423
|
"content": Array [
|
|
@@ -575,19 +572,19 @@ it("[markdown]: broken_refs", () => {
|
|
|
575
572
|
"name": "root",
|
|
576
573
|
"type": "block",
|
|
577
574
|
}
|
|
578
|
-
`)
|
|
579
|
-
})
|
|
575
|
+
`)
|
|
576
|
+
})
|
|
580
577
|
|
|
581
|
-
it(
|
|
578
|
+
it('[markdown]: parse code', () => {
|
|
582
579
|
const pod = `
|
|
583
580
|
\`\`\`javascript
|
|
584
581
|
var documentation = require('documentation');
|
|
585
582
|
\`\`\`
|
|
586
|
-
|
|
587
|
-
const tree = process(pod)
|
|
588
|
-
const r = validateAstTree([tree])
|
|
589
|
-
expect(r).toEqual([])
|
|
590
|
-
const errorDescribe = isValidateError(r, tree)
|
|
583
|
+
`
|
|
584
|
+
const tree = process(pod)
|
|
585
|
+
const r = validateAstTree([tree])
|
|
586
|
+
expect(r).toEqual([])
|
|
587
|
+
const errorDescribe = isValidateError(r, tree)
|
|
591
588
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
592
589
|
Object {
|
|
593
590
|
"content": Array [
|
|
@@ -628,10 +625,10 @@ var documentation = require('documentation');
|
|
|
628
625
|
"name": "root",
|
|
629
626
|
"type": "block",
|
|
630
627
|
}
|
|
631
|
-
`)
|
|
632
|
-
})
|
|
628
|
+
`)
|
|
629
|
+
})
|
|
633
630
|
|
|
634
|
-
it(
|
|
631
|
+
it('[markdown]: inline_code', () => {
|
|
635
632
|
const pod = `
|
|
636
633
|
*This text will be italic*
|
|
637
634
|
_This will also be italic_
|
|
@@ -640,11 +637,11 @@ _This will also be italic_
|
|
|
640
637
|
__This will also be bold__
|
|
641
638
|
|
|
642
639
|
_You **can** combine them_
|
|
643
|
-
|
|
644
|
-
const tree = process(pod)
|
|
645
|
-
const r = validateAstTree([tree])
|
|
646
|
-
expect(r).toEqual([])
|
|
647
|
-
const errorDescribe = isValidateError(r, tree)
|
|
640
|
+
`
|
|
641
|
+
const tree = process(pod)
|
|
642
|
+
const r = validateAstTree([tree])
|
|
643
|
+
expect(r).toEqual([])
|
|
644
|
+
const errorDescribe = isValidateError(r, tree)
|
|
648
645
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
649
646
|
Object {
|
|
650
647
|
"content": Array [
|
|
@@ -761,18 +758,18 @@ _You **can** combine them_
|
|
|
761
758
|
"name": "root",
|
|
762
759
|
"type": "block",
|
|
763
760
|
}
|
|
764
|
-
`)
|
|
765
|
-
})
|
|
761
|
+
`)
|
|
762
|
+
})
|
|
766
763
|
|
|
767
|
-
it(
|
|
764
|
+
it('[markdown]: thematic_break', () => {
|
|
768
765
|
const pod = `
|
|
769
766
|
|
|
770
767
|
---
|
|
771
|
-
|
|
772
|
-
const tree = process(pod)
|
|
773
|
-
const r = validateAstTree([tree])
|
|
774
|
-
expect(r).toEqual([])
|
|
775
|
-
const errorDescribe = isValidateError(r, tree)
|
|
768
|
+
`
|
|
769
|
+
const tree = process(pod)
|
|
770
|
+
const r = validateAstTree([tree])
|
|
771
|
+
expect(r).toEqual([])
|
|
772
|
+
const errorDescribe = isValidateError(r, tree)
|
|
776
773
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
777
774
|
Object {
|
|
778
775
|
"content": Array [],
|
|
@@ -781,20 +778,20 @@ it("[markdown]: thematic_break", () => {
|
|
|
781
778
|
"name": "root",
|
|
782
779
|
"type": "block",
|
|
783
780
|
}
|
|
784
|
-
`)
|
|
785
|
-
})
|
|
781
|
+
`)
|
|
782
|
+
})
|
|
786
783
|
|
|
787
|
-
it(
|
|
784
|
+
it('[markdown]: blockquote', () => {
|
|
788
785
|
const pod = `
|
|
789
786
|
As Kanye West said:
|
|
790
787
|
|
|
791
788
|
> We're living the future so
|
|
792
789
|
> the present is our past.
|
|
793
|
-
|
|
794
|
-
const tree = process(pod)
|
|
795
|
-
const r = validateAstTree([tree])
|
|
796
|
-
expect(r).toEqual([])
|
|
797
|
-
const errorDescribe = isValidateError(r, tree)
|
|
790
|
+
`
|
|
791
|
+
const tree = process(pod)
|
|
792
|
+
const r = validateAstTree([tree])
|
|
793
|
+
expect(r).toEqual([])
|
|
794
|
+
const errorDescribe = isValidateError(r, tree)
|
|
798
795
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
799
796
|
Object {
|
|
800
797
|
"content": Array [
|
|
@@ -867,20 +864,20 @@ As Kanye West said:
|
|
|
867
864
|
"name": "root",
|
|
868
865
|
"type": "block",
|
|
869
866
|
}
|
|
870
|
-
`)
|
|
871
|
-
})
|
|
867
|
+
`)
|
|
868
|
+
})
|
|
872
869
|
|
|
873
|
-
it(
|
|
870
|
+
it('[markdown]: parse table', () => {
|
|
874
871
|
const pod = `
|
|
875
872
|
First Header | Second Header
|
|
876
873
|
------------ | -------------
|
|
877
874
|
Content from cell 1 | Content from cell 2
|
|
878
875
|
Content in the first column | Content in the second column
|
|
879
|
-
|
|
880
|
-
const tree = process(pod)
|
|
881
|
-
const r = validateAstTree([tree])
|
|
882
|
-
expect(r).toEqual([])
|
|
883
|
-
const errorDescribe = isValidateError(r, tree)
|
|
876
|
+
`
|
|
877
|
+
const tree = process(pod)
|
|
878
|
+
const r = validateAstTree([tree])
|
|
879
|
+
expect(r).toEqual([])
|
|
880
|
+
const errorDescribe = isValidateError(r, tree)
|
|
884
881
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
885
882
|
Object {
|
|
886
883
|
"content": Array [
|
|
@@ -1096,17 +1093,17 @@ Content in the first column | Content in the second column
|
|
|
1096
1093
|
"name": "root",
|
|
1097
1094
|
"type": "block",
|
|
1098
1095
|
}
|
|
1099
|
-
`)
|
|
1100
|
-
})
|
|
1096
|
+
`)
|
|
1097
|
+
})
|
|
1101
1098
|
|
|
1102
|
-
it(
|
|
1099
|
+
it('[markdown]: parse strikethrough', () => {
|
|
1103
1100
|
const pod = `
|
|
1104
1101
|
~~this~~
|
|
1105
|
-
|
|
1106
|
-
const tree = process(pod)
|
|
1107
|
-
const r = validateAstTree([tree])
|
|
1108
|
-
expect(r).toEqual([])
|
|
1109
|
-
const errorDescribe = isValidateError(r, tree)
|
|
1102
|
+
`
|
|
1103
|
+
const tree = process(pod)
|
|
1104
|
+
const r = validateAstTree([tree])
|
|
1105
|
+
expect(r).toEqual([])
|
|
1106
|
+
const errorDescribe = isValidateError(r, tree)
|
|
1110
1107
|
expect(process(pod)).toMatchInlineSnapshot(`
|
|
1111
1108
|
Object {
|
|
1112
1109
|
"content": Array [
|
|
@@ -1143,10 +1140,10 @@ it("[markdown]: parse strikethrough", () => {
|
|
|
1143
1140
|
"name": "root",
|
|
1144
1141
|
"type": "block",
|
|
1145
1142
|
}
|
|
1146
|
-
`)
|
|
1147
|
-
})
|
|
1148
|
-
it(
|
|
1149
|
-
|
|
1143
|
+
`)
|
|
1144
|
+
})
|
|
1145
|
+
it('[markdown]: parse diagrams', () => {
|
|
1146
|
+
const pod = `
|
|
1150
1147
|
\`\`\`mermaids caption="1"
|
|
1151
1148
|
graph TD;
|
|
1152
1149
|
A-->B;
|
|
@@ -1154,7 +1151,7 @@ graph TD;
|
|
|
1154
1151
|
B-->D;
|
|
1155
1152
|
C-->D;
|
|
1156
1153
|
\`\`\`
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1154
|
+
`
|
|
1155
|
+
const tree = process(pod)
|
|
1156
|
+
// console.log(JSON.stringify(tree, null,2 ))
|
|
1160
1157
|
})
|
package/t/plugin.test.tsx
CHANGED
|
@@ -1,43 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { frozenIds,
|
|
3
|
-
import { PluginRegister } from
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { makeTestPodlite } from "@podlite/to-jsx";
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { PodliteDocument, frozenIds, podlitePluggable, validateAstTree } from '@podlite/schema'
|
|
3
|
+
import { PluginRegister } from '../src'
|
|
4
|
+
import { renderToStaticMarkup } from 'react-dom/server'
|
|
5
|
+
import { makeTestPodlite } from '@podlite/to-jsx'
|
|
7
6
|
|
|
8
7
|
const Podlite = makeTestPodlite(
|
|
9
|
-
|
|
8
|
+
podlitePluggable().use({
|
|
10
9
|
...PluginRegister,
|
|
11
|
-
})
|
|
12
|
-
)
|
|
13
|
-
|
|
14
|
-
const root = document.body.appendChild(document.createElement("div"));
|
|
15
|
-
|
|
16
|
-
function render(jsx) {
|
|
17
|
-
return ReactDOM.render(jsx, root);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
afterEach(() => ReactDOM.unmountComponentAtNode(root));
|
|
10
|
+
}),
|
|
11
|
+
)
|
|
21
12
|
|
|
22
13
|
export const parse = (str: string): PodliteDocument => {
|
|
23
|
-
let podlite =
|
|
14
|
+
let podlite = podlitePluggable().use({
|
|
24
15
|
...PluginRegister,
|
|
25
|
-
})
|
|
26
|
-
let tree = podlite.parse(str)
|
|
27
|
-
const asAst = podlite.toAstResult(tree)
|
|
28
|
-
return frozenIds()(asAst.interator)
|
|
29
|
-
}
|
|
16
|
+
})
|
|
17
|
+
let tree = podlite.parse(str)
|
|
18
|
+
const asAst = podlite.toAstResult(tree)
|
|
19
|
+
return frozenIds()(asAst.interator)
|
|
20
|
+
}
|
|
30
21
|
|
|
31
|
-
it(
|
|
22
|
+
it('=markdown: check line offset', () => {
|
|
32
23
|
const pod = `
|
|
33
24
|
=para test
|
|
34
|
-
=
|
|
25
|
+
=markdown
|
|
35
26
|
header1
|
|
36
|
-
|
|
37
|
-
const tree = parse(pod)
|
|
27
|
+
`
|
|
28
|
+
const tree = parse(pod)
|
|
38
29
|
// console.log(JSON.stringify(tree, null, 2));
|
|
39
|
-
const r = validateAstTree([tree])
|
|
40
|
-
expect(r).toEqual([])
|
|
30
|
+
const r = validateAstTree([tree])
|
|
31
|
+
expect(r).toEqual([])
|
|
41
32
|
expect(parse(pod)).toMatchInlineSnapshot(`
|
|
42
33
|
Object {
|
|
43
34
|
"content": Array [
|
|
@@ -134,7 +125,7 @@ header1
|
|
|
134
125
|
},
|
|
135
126
|
},
|
|
136
127
|
"margin": "",
|
|
137
|
-
"name": "
|
|
128
|
+
"name": "markdown",
|
|
138
129
|
"type": "block",
|
|
139
130
|
},
|
|
140
131
|
],
|
|
@@ -143,20 +134,20 @@ header1
|
|
|
143
134
|
"name": "root",
|
|
144
135
|
"type": "block",
|
|
145
136
|
}
|
|
146
|
-
`)
|
|
147
|
-
})
|
|
137
|
+
`)
|
|
138
|
+
})
|
|
148
139
|
|
|
149
|
-
it(
|
|
140
|
+
it('=markdown: jsx', () => {
|
|
150
141
|
const pod = `
|
|
151
142
|
=para test
|
|
152
|
-
=begin
|
|
143
|
+
=begin markdown
|
|
153
144
|
header1
|
|
154
145
|
=head1 **ss**
|
|
155
146
|
ddd
|
|
156
|
-
=end
|
|
157
|
-
|
|
158
|
-
render(<Podlite>{pod}</Podlite>);
|
|
159
|
-
expect(
|
|
147
|
+
=end markdown
|
|
148
|
+
`
|
|
149
|
+
// render(<Podlite>{pod}</Podlite>);
|
|
150
|
+
expect(renderToStaticMarkup(<Podlite>{pod}</Podlite>)).toMatchInlineSnapshot(`
|
|
160
151
|
<div id="id">
|
|
161
152
|
<p>
|
|
162
153
|
test
|
|
@@ -172,17 +163,17 @@ it("=Markdown: jsx", () => {
|
|
|
172
163
|
</p>
|
|
173
164
|
<p>
|
|
174
165
|
</p>
|
|
175
|
-
`)
|
|
176
|
-
})
|
|
166
|
+
`)
|
|
167
|
+
})
|
|
177
168
|
|
|
178
|
-
it("=
|
|
169
|
+
it("=markdown: check 'delete' line element", () => {
|
|
179
170
|
const pod = `
|
|
180
|
-
=begin
|
|
171
|
+
=begin markdown
|
|
181
172
|
asd ~~asdsd~~
|
|
182
|
-
=end
|
|
183
|
-
|
|
184
|
-
render(<Podlite>{pod}</Podlite>);
|
|
185
|
-
expect(
|
|
173
|
+
=end markdown
|
|
174
|
+
`
|
|
175
|
+
// render(<Podlite>{pod}</Podlite>);
|
|
176
|
+
expect(renderToStaticMarkup(<Podlite>{pod}</Podlite>)).toMatchInlineSnapshot(`
|
|
186
177
|
<p id="id">
|
|
187
178
|
asd
|
|
188
179
|
<del>
|
|
@@ -191,21 +182,21 @@ asd ~~asdsd~~
|
|
|
191
182
|
</p>
|
|
192
183
|
<p>
|
|
193
184
|
</p>
|
|
194
|
-
`)
|
|
195
|
-
})
|
|
185
|
+
`)
|
|
186
|
+
})
|
|
196
187
|
|
|
197
|
-
it(
|
|
188
|
+
it('=markdown: table render', () => {
|
|
198
189
|
const pod = `
|
|
199
|
-
=begin
|
|
190
|
+
=begin markdown
|
|
200
191
|
| Syntax | Description |
|
|
201
192
|
| ----------- | ----------- |
|
|
202
193
|
| Header | Title |
|
|
203
194
|
| Paragraph | Text |
|
|
204
|
-
=end
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
expect(
|
|
195
|
+
=end markdown
|
|
196
|
+
`
|
|
197
|
+
// render(<Podlite>{pod}</Podlite>);
|
|
198
|
+
// console.log(root.innerHTML);
|
|
199
|
+
expect(renderToStaticMarkup(<Podlite>{pod}</Podlite>)).toMatchInlineSnapshot(`
|
|
209
200
|
<table id="id">
|
|
210
201
|
<caption class="caption">
|
|
211
202
|
</caption>
|
|
@@ -238,5 +229,5 @@ it("=Markdown: table render", () => {
|
|
|
238
229
|
</table>
|
|
239
230
|
<p>
|
|
240
231
|
</p>
|
|
241
|
-
`)
|
|
242
|
-
})
|
|
232
|
+
`)
|
|
233
|
+
})
|