sommark 3.2.0 → 3.3.1
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/README.md +7 -0
- package/cli/commands/build.js +2 -1
- package/cli/commands/init.js +2 -6
- package/cli/commands/list.js +17 -12
- package/cli/commands/print.js +7 -2
- package/cli/helpers/transpile.js +2 -1
- package/core/errors.js +22 -9
- package/core/labels.js +3 -0
- package/core/lexer.js +206 -567
- package/core/parser.js +139 -39
- package/core/pluginManager.js +33 -23
- package/core/plugins/comment-remover.js +3 -3
- package/core/plugins/module-system.js +163 -124
- package/core/plugins/raw-content-plugin.js +15 -9
- package/core/plugins/rules-validation-plugin.js +2 -2
- package/core/plugins/sommark-format.js +105 -72
- package/core/transpiler.js +70 -8
- package/coverage_test.js +21 -0
- package/helpers/utils.js +27 -0
- package/index.js +25 -16
- package/mappers/languages/html.js +5 -10
- package/package.json +1 -1
- package/test_format_fix.js +42 -0
- package/v3-todo.smark +68 -70
- package/core/plugins/quote-escaper.js +0 -37
- package/format.js +0 -23
- package/unformatted.smark +0 -90
package/unformatted.smark
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
[ Document = version:1.0, type: article ]
|
|
2
|
-
# Starting the document with messy comments
|
|
3
|
-
( Welcome )->(Strong) to the test document!
|
|
4
|
-
[ Section = id: intro ]
|
|
5
|
-
[ Paragraph ]
|
|
6
|
-
This is [Block][end] the first paragraph. It has some weird spaces and
|
|
7
|
-
attached.[Block][end]
|
|
8
|
-
[ end ]
|
|
9
|
-
[ Paragraph ]
|
|
10
|
-
Another paragraph with [ nested ] text that is not a real block, wait, [ nested ] is a block!
|
|
11
|
-
[ end ]
|
|
12
|
-
[end]
|
|
13
|
-
[end]
|
|
14
|
-
[ Section = id: content ][ List = type: bullet ][ Item ]( Apple )->(Bold)
|
|
15
|
-
[ end ]
|
|
16
|
-
[ Item ]
|
|
17
|
-
Banana[ end ][ Item ]Cherry
|
|
18
|
-
[ end ]
|
|
19
|
-
[ end ]
|
|
20
|
-
@_ CodeSnippet _@ : javascript;
|
|
21
|
-
function doSomething() {
|
|
22
|
-
let x = 10;
|
|
23
|
-
return x * 2;
|
|
24
|
-
}
|
|
25
|
-
@_ end _@
|
|
26
|
-
[ Paragraph ]
|
|
27
|
-
Some text after the code snippet.
|
|
28
|
-
[ end ]
|
|
29
|
-
[ Subsection = title: "Deep Nesting" ]
|
|
30
|
-
[ Level1 ][ Level2 ][ Level3 ]
|
|
31
|
-
[ Level4 ]
|
|
32
|
-
[ Level5 ]
|
|
33
|
-
( Deeply )->( Nested )
|
|
34
|
-
[ end ]
|
|
35
|
-
[ end ]
|
|
36
|
-
[ end ]
|
|
37
|
-
[ end ]
|
|
38
|
-
[ end ]
|
|
39
|
-
[ end ]
|
|
40
|
-
[ Subsection = title: "Mix and Match" ]
|
|
41
|
-
[ Paragraph ]
|
|
42
|
-
( Start )->( A ) ( Middle )->( B ) ( End )->( C )
|
|
43
|
-
[ end ]
|
|
44
|
-
[ end ]
|
|
45
|
-
[ Section = id: outro ]
|
|
46
|
-
[ Paragraph ]
|
|
47
|
-
Thank you for reading!
|
|
48
|
-
# A wild comment appears
|
|
49
|
-
[ end ]
|
|
50
|
-
@_ RawText _@ : plain ;
|
|
51
|
-
Just some raw text.
|
|
52
|
-
It should preserve its internal spacing.
|
|
53
|
-
|
|
54
|
-
But the at-block itself will be properly indented.
|
|
55
|
-
@_ end _@
|
|
56
|
-
[ end ]
|
|
57
|
-
[ Section = id: footer ]
|
|
58
|
-
[ Paragraph ]
|
|
59
|
-
( Copyright )->( Small ) 2023. All rights reserved.
|
|
60
|
-
[ end ]
|
|
61
|
-
[ end ]
|
|
62
|
-
[ Section = empty ]
|
|
63
|
-
[ end ]
|
|
64
|
-
[ Section = single_line ]
|
|
65
|
-
Single line content.
|
|
66
|
-
[ end ]
|
|
67
|
-
[ Section = messy_arguments , another_arg: value ]
|
|
68
|
-
Content here.
|
|
69
|
-
[ end ]
|
|
70
|
-
[ Section = id: mixed_content ]
|
|
71
|
-
Text before block.
|
|
72
|
-
[ Paragraph ]
|
|
73
|
-
Inside block.
|
|
74
|
-
[ end ]
|
|
75
|
-
Text after block.
|
|
76
|
-
[ end ]
|
|
77
|
-
[ Section = id: last_one ]
|
|
78
|
-
[ Paragraph ]
|
|
79
|
-
( The )->(bold)
|
|
80
|
-
[ end ]
|
|
81
|
-
[ end ]
|
|
82
|
-
[ Section = id: extra ]
|
|
83
|
-
[ Paragraph ]
|
|
84
|
-
( Extra )->( One )text glued to an inline!
|
|
85
|
-
( Extra )->( Two )
|
|
86
|
-
[ end ]
|
|
87
|
-
[ end ]
|
|
88
|
-
[end]
|
|
89
|
-
[end]
|
|
90
|
-
[end]
|