@wdprlib/parser 1.1.1 → 1.1.2

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
@@ -5113,6 +5113,10 @@ function parseBibliographyEntry(ctx, startPos) {
5113
5113
  consumed++;
5114
5114
  break;
5115
5115
  }
5116
+ contentNodes.push({ element: "line-break" });
5117
+ pos++;
5118
+ consumed++;
5119
+ continue;
5116
5120
  }
5117
5121
  const inlineCtx = { ...ctx, pos };
5118
5122
  const result = parseInlineUntil(inlineCtx, "NEWLINE");
@@ -5610,6 +5614,11 @@ var linkTripleRule = {
5610
5614
  break;
5611
5615
  }
5612
5616
  if (token.type === "NEWLINE") {
5617
+ if (foundPipe) {
5618
+ labelText += " ";
5619
+ } else {
5620
+ target += " ";
5621
+ }
5613
5622
  consumed++;
5614
5623
  pos++;
5615
5624
  continue;
@@ -6716,7 +6725,15 @@ var footnoteRule = {
6716
6725
  if (token.type === "NEWLINE") {
6717
6726
  pos++;
6718
6727
  consumed++;
6719
- if (ctx.tokens[pos]?.type === "NEWLINE") {
6728
+ let peekPos = pos;
6729
+ let peekConsumed = 0;
6730
+ while (ctx.tokens[peekPos]?.type === "WHITESPACE") {
6731
+ peekPos++;
6732
+ peekConsumed++;
6733
+ }
6734
+ if (ctx.tokens[peekPos]?.type === "NEWLINE") {
6735
+ pos = peekPos;
6736
+ consumed += peekConsumed;
6720
6737
  while (ctx.tokens[pos]?.type === "NEWLINE") {
6721
6738
  pos++;
6722
6739
  consumed++;
@@ -7213,7 +7230,7 @@ var anchorRule = {
7213
7230
  consumed++;
7214
7231
  }
7215
7232
  foundClose = true;
7216
- while (paragraphStrip && ctx.tokens[pos]?.type === "NEWLINE") {
7233
+ if (paragraphStrip && ctx.tokens[pos]?.type === "NEWLINE" && ctx.tokens[pos + 1]?.type !== "NEWLINE") {
7217
7234
  pos++;
7218
7235
  consumed++;
7219
7236
  }
package/dist/index.js CHANGED
@@ -5059,6 +5059,10 @@ function parseBibliographyEntry(ctx, startPos) {
5059
5059
  consumed++;
5060
5060
  break;
5061
5061
  }
5062
+ contentNodes.push({ element: "line-break" });
5063
+ pos++;
5064
+ consumed++;
5065
+ continue;
5062
5066
  }
5063
5067
  const inlineCtx = { ...ctx, pos };
5064
5068
  const result = parseInlineUntil(inlineCtx, "NEWLINE");
@@ -5556,6 +5560,11 @@ var linkTripleRule = {
5556
5560
  break;
5557
5561
  }
5558
5562
  if (token.type === "NEWLINE") {
5563
+ if (foundPipe) {
5564
+ labelText += " ";
5565
+ } else {
5566
+ target += " ";
5567
+ }
5559
5568
  consumed++;
5560
5569
  pos++;
5561
5570
  continue;
@@ -6662,7 +6671,15 @@ var footnoteRule = {
6662
6671
  if (token.type === "NEWLINE") {
6663
6672
  pos++;
6664
6673
  consumed++;
6665
- if (ctx.tokens[pos]?.type === "NEWLINE") {
6674
+ let peekPos = pos;
6675
+ let peekConsumed = 0;
6676
+ while (ctx.tokens[peekPos]?.type === "WHITESPACE") {
6677
+ peekPos++;
6678
+ peekConsumed++;
6679
+ }
6680
+ if (ctx.tokens[peekPos]?.type === "NEWLINE") {
6681
+ pos = peekPos;
6682
+ consumed += peekConsumed;
6666
6683
  while (ctx.tokens[pos]?.type === "NEWLINE") {
6667
6684
  pos++;
6668
6685
  consumed++;
@@ -7159,7 +7176,7 @@ var anchorRule = {
7159
7176
  consumed++;
7160
7177
  }
7161
7178
  foundClose = true;
7162
- while (paragraphStrip && ctx.tokens[pos]?.type === "NEWLINE") {
7179
+ if (paragraphStrip && ctx.tokens[pos]?.type === "NEWLINE" && ctx.tokens[pos + 1]?.type !== "NEWLINE") {
7163
7180
  pos++;
7164
7181
  consumed++;
7165
7182
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdprlib/parser",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Parser for Wikidot markup",
5
5
  "keywords": [
6
6
  "ast",