@wdprlib/parser 2.0.2 → 2.0.4

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/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++;
@@ -9976,7 +9986,7 @@ function resolveIncludes(source, fetcher, options) {
9976
9986
  };
9977
9987
  return expandText(source, cachedFetcher, 0, maxDepth, []);
9978
9988
  }
9979
- var INCLUDE_PATTERN = /\[\[include\s([^\]]*(?:\](?!\])[^\]]*)*)\]\]/gi;
9989
+ var INCLUDE_PATTERN = /^\[\[include\s([^\]]*(?:\](?!\])[^\]]*)*)\]\]/gim;
9980
9990
  function parseIncludeDirective(inner) {
9981
9991
  const normalized = inner.replace(/\n/g, " ");
9982
9992
  const parts = normalized.split("|");
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++;
@@ -9921,7 +9931,7 @@ function resolveIncludes(source, fetcher, options) {
9921
9931
  };
9922
9932
  return expandText(source, cachedFetcher, 0, maxDepth, []);
9923
9933
  }
9924
- var INCLUDE_PATTERN = /\[\[include\s([^\]]*(?:\](?!\])[^\]]*)*)\]\]/gi;
9934
+ var INCLUDE_PATTERN = /^\[\[include\s([^\]]*(?:\](?!\])[^\]]*)*)\]\]/gim;
9925
9935
  function parseIncludeDirective(inner) {
9926
9936
  const normalized = inner.replace(/\n/g, " ");
9927
9937
  const parts = normalized.split("|");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdprlib/parser",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Parser for Wikidot markup",
5
5
  "keywords": [
6
6
  "ast",