squiffy-compiler 6.0.0-beta.0 → 6.0.0-beta.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.
Files changed (2) hide show
  1. package/dist/compiler.js +8 -1
  2. package/package.json +2 -2
package/dist/compiler.js CHANGED
@@ -383,8 +383,15 @@ export async function compile(settings) {
383
383
  // Link destination data may look like:
384
384
  // passageName
385
385
  // passageName, my_attribute=2
386
+ // passage name with a comma, in the name
386
387
  // We're only interested in checking if the named passage or section exists.
387
- const linkDestination = link.split(",")[0];
388
+ // First check if the full link is a valid destination (handles names containing commas).
389
+ const trimmedLink = link.trim();
390
+ if (Object.keys(keys).includes(trimmedLink)) {
391
+ return true;
392
+ }
393
+ // Otherwise, assume a comma separates the destination from setters.
394
+ const linkDestination = trimmedLink.split(",")[0].trim();
388
395
  return Object.keys(keys).includes(linkDestination);
389
396
  }
390
397
  function showBadLinksWarning(badLinks, linkTo, before, after, section, passage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squiffy-compiler",
3
- "version": "6.0.0-beta.0",
3
+ "version": "6.0.0-beta.1",
4
4
  "description": "A tool for creating multiple-choice interactive stories",
5
5
  "author": "Alex Warren",
6
6
  "contributors": [
@@ -31,5 +31,5 @@
31
31
  "dist"
32
32
  ],
33
33
  "type": "module",
34
- "gitHead": "dadcab6940e5e7ffdd600e8821c9297fdbf93160"
34
+ "gitHead": "da6023a5cde6b179ce756f8f03bfc2b4ff7a0274"
35
35
  }