@wdprlib/parser 2.0.0 → 2.0.3
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 +2 -1
- package/dist/index.cjs +10 -0
- package/dist/index.js +10 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @wdprlib/parser
|
|
2
2
|
|
|
3
|
-
Wikidot markup
|
|
3
|
+
Parser for Wikidot markup.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -56,6 +56,7 @@ const resolved = await resolveModules(ast, {
|
|
|
56
56
|
|
|
57
57
|
- [@wdprlib/ast](https://www.npmjs.com/package/@wdprlib/ast) - AST type definitions
|
|
58
58
|
- [@wdprlib/render](https://www.npmjs.com/package/@wdprlib/render) - HTML renderer
|
|
59
|
+
- [@wdprlib/decompiler](https://www.npmjs.com/package/@wdprlib/decompiler) - HTML to Wikidot decompiler
|
|
59
60
|
- [@wdprlib/runtime](https://www.npmjs.com/package/@wdprlib/runtime) - Client-side runtime
|
|
60
61
|
|
|
61
62
|
## License
|
package/dist/index.cjs
CHANGED
|
@@ -2950,6 +2950,16 @@ function parseTableCell(ctx, startPos, cellStart) {
|
|
|
2950
2950
|
if (isTableColToken(token.type)) {
|
|
2951
2951
|
break;
|
|
2952
2952
|
}
|
|
2953
|
+
if (token.type === "WHITESPACE") {
|
|
2954
|
+
const nextTok = ctx.tokens[pos + 1];
|
|
2955
|
+
const afterTok = ctx.tokens[pos + 2];
|
|
2956
|
+
if (nextTok?.type === "UNDERSCORE" && afterTok && (afterTok.type === "NEWLINE" || afterTok.type === "EOF")) {
|
|
2957
|
+
children.push({ element: "line-break" });
|
|
2958
|
+
pos += 3;
|
|
2959
|
+
consumed += 3;
|
|
2960
|
+
continue;
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2953
2963
|
if (token.type === "WHITESPACE") {
|
|
2954
2964
|
children.push({ element: "text", data: token.value });
|
|
2955
2965
|
pos++;
|
package/dist/index.js
CHANGED
|
@@ -2895,6 +2895,16 @@ function parseTableCell(ctx, startPos, cellStart) {
|
|
|
2895
2895
|
if (isTableColToken(token.type)) {
|
|
2896
2896
|
break;
|
|
2897
2897
|
}
|
|
2898
|
+
if (token.type === "WHITESPACE") {
|
|
2899
|
+
const nextTok = ctx.tokens[pos + 1];
|
|
2900
|
+
const afterTok = ctx.tokens[pos + 2];
|
|
2901
|
+
if (nextTok?.type === "UNDERSCORE" && afterTok && (afterTok.type === "NEWLINE" || afterTok.type === "EOF")) {
|
|
2902
|
+
children.push({ element: "line-break" });
|
|
2903
|
+
pos += 3;
|
|
2904
|
+
consumed += 3;
|
|
2905
|
+
continue;
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2898
2908
|
if (token.type === "WHITESPACE") {
|
|
2899
2909
|
children.push({ element: "text", data: token.value });
|
|
2900
2910
|
pos++;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdprlib/parser",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Parser for Wikidot markup",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ast",
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@braintree/sanitize-url": "^7.1.1",
|
|
42
|
-
"@wdprlib/ast": "1.2.
|
|
42
|
+
"@wdprlib/ast": "1.2.1"
|
|
43
43
|
}
|
|
44
44
|
}
|