@wdprlib/parser 2.0.4 → 2.0.6

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
@@ -5891,10 +5891,9 @@ var linkTripleRule = {
5891
5891
  };
5892
5892
  }
5893
5893
  let finalTarget = trimmedTarget;
5894
- if (trimmedTarget === "*" && foundPipe) {
5895
- finalTarget = "";
5896
- }
5897
- if (trimmedTarget.startsWith("*") && !foundPipe) {
5894
+ let hasStar = false;
5895
+ if (trimmedTarget.startsWith("*")) {
5896
+ hasStar = true;
5898
5897
  finalTarget = trimmedTarget.slice(1);
5899
5898
  }
5900
5899
  const { linkType, link } = determineLinkTypeAndLocation(finalTarget);
@@ -5904,7 +5903,7 @@ var linkTripleRule = {
5904
5903
  displayText = trimmedLabel || finalTarget;
5905
5904
  } else {
5906
5905
  const colonIdx = trimmedTarget.indexOf(":");
5907
- if (colonIdx !== -1 && !trimmedTarget.startsWith("http")) {
5906
+ if (colonIdx !== -1 && !trimmedTarget.startsWith("http") && !trimmedTarget.startsWith("*")) {
5908
5907
  displayText = trimmedTarget.slice(colonIdx + 1).trim();
5909
5908
  } else {
5910
5909
  displayText = trimmedTarget;
@@ -5921,7 +5920,7 @@ var linkTripleRule = {
5921
5920
  link,
5922
5921
  extra: null,
5923
5922
  label,
5924
- target: null
5923
+ target: hasStar && linkType === "direct" ? "new-tab" : null
5925
5924
  }
5926
5925
  }
5927
5926
  ],
package/dist/index.js CHANGED
@@ -5836,10 +5836,9 @@ var linkTripleRule = {
5836
5836
  };
5837
5837
  }
5838
5838
  let finalTarget = trimmedTarget;
5839
- if (trimmedTarget === "*" && foundPipe) {
5840
- finalTarget = "";
5841
- }
5842
- if (trimmedTarget.startsWith("*") && !foundPipe) {
5839
+ let hasStar = false;
5840
+ if (trimmedTarget.startsWith("*")) {
5841
+ hasStar = true;
5843
5842
  finalTarget = trimmedTarget.slice(1);
5844
5843
  }
5845
5844
  const { linkType, link } = determineLinkTypeAndLocation(finalTarget);
@@ -5849,7 +5848,7 @@ var linkTripleRule = {
5849
5848
  displayText = trimmedLabel || finalTarget;
5850
5849
  } else {
5851
5850
  const colonIdx = trimmedTarget.indexOf(":");
5852
- if (colonIdx !== -1 && !trimmedTarget.startsWith("http")) {
5851
+ if (colonIdx !== -1 && !trimmedTarget.startsWith("http") && !trimmedTarget.startsWith("*")) {
5853
5852
  displayText = trimmedTarget.slice(colonIdx + 1).trim();
5854
5853
  } else {
5855
5854
  displayText = trimmedTarget;
@@ -5866,7 +5865,7 @@ var linkTripleRule = {
5866
5865
  link,
5867
5866
  extra: null,
5868
5867
  label,
5869
- target: null
5868
+ target: hasStar && linkType === "direct" ? "new-tab" : null
5870
5869
  }
5871
5870
  }
5872
5871
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdprlib/parser",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Parser for Wikidot markup",
5
5
  "keywords": [
6
6
  "ast",