extwee 2.2.0 → 2.2.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 (42) hide show
  1. package/build/extwee +0 -0
  2. package/build/extwee.web.min.js +1 -1
  3. package/docs/_sidebar.md +1 -0
  4. package/docs/examples/dynamicPassages.md +1 -1
  5. package/docs/examples/twsToTwee.md +1 -1
  6. package/index.js +1 -1
  7. package/package.json +15 -12
  8. package/src/JSON/parse.js +1 -1
  9. package/src/Passage.js +9 -28
  10. package/src/Story.js +9 -6
  11. package/src/TWS/parse.js +1 -1
  12. package/src/Twee/parse.js +1 -1
  13. package/src/Twine1HTML/compile.js +1 -1
  14. package/src/Twine1HTML/parse.js +1 -1
  15. package/src/Twine2ArchiveHTML/compile.js +1 -1
  16. package/src/Twine2HTML/compile.js +1 -1
  17. package/src/Twine2HTML/parse.js +5 -4
  18. package/test/JSON/JSON.Parse.test.js +20 -20
  19. package/test/Passage.test.js +69 -0
  20. package/test/Story.test.js +42 -3
  21. package/test/Twine1HTML/Twine1HTML.Compile.test.js +1 -1
  22. package/test/Twine2ArchiveHTML/Twine2ArchiveHTML.Compile.test.js +1 -1
  23. package/test/Twine2HTML/Twine2HTML.Compile.test.js +1 -1
  24. package/test/Twine2HTML/Twine2HTML.Parse.test.js +6 -5
  25. package/test/Twine2HTML/Twine2HTMLParser/unescaping.html +33 -0
  26. package/tsconfig.json +21 -0
  27. package/types/index.d.ts +14 -0
  28. package/types/src/JSON/parse.d.ts +8 -0
  29. package/types/src/Passage.d.ts +72 -0
  30. package/types/src/Story.d.ts +161 -0
  31. package/types/src/StoryFormat/parse.d.ts +7 -0
  32. package/types/src/StoryFormat.d.ts +97 -0
  33. package/types/src/TWS/parse.d.ts +10 -0
  34. package/types/src/Twee/parse.d.ts +10 -0
  35. package/types/src/Twine1HTML/compile.d.ts +17 -0
  36. package/types/src/Twine1HTML/parse.d.ts +10 -0
  37. package/types/src/Twine2ArchiveHTML/compile.d.ts +6 -0
  38. package/types/src/Twine2ArchiveHTML/parse.d.ts +6 -0
  39. package/types/src/Twine2HTML/compile.d.ts +9 -0
  40. package/types/src/Twine2HTML/parse.d.ts +17 -0
  41. package/types/src/extwee.d.ts +2 -0
  42. package/web-index.js +1 -1
@@ -1,5 +1,5 @@
1
1
  import { readFileSync } from 'node:fs';
2
- import { parse as parseTwine2HTML, escapeMetacharacters } from '../../src/Twine2HTML/parse.js';
2
+ import { parse as parseTwine2HTML } from '../../src/Twine2HTML/parse.js';
3
3
 
4
4
  // Pull the name and version of this project from package.json.
5
5
  // These are used as the 'creator' and 'creator-version'.
@@ -163,10 +163,11 @@ describe('Twine2HTMLParser', () => {
163
163
  });
164
164
  });
165
165
 
166
- describe('#escapeMetacharacters()', () => {
167
- it('Should escape metacharacters', () => {
168
- /* eslint no-useless-escape: "off" */
169
- expect(escapeMetacharacters('\\\{\\\}\\\[\\\]\\\\')).toBe('\\\\{\\\\}\\\\[\\\\]\\\\');
166
+ describe('Unescaping', () => {
167
+ it('Should unescape HTML metacharacters for passage searching', () => {
168
+ const fr = readFileSync('test/Twine2HTML/Twine2HTMLParser/unescaping.html', 'utf-8');
169
+ const story = parseTwine2HTML(fr);
170
+ expect(story.getPassageByName('"Test"').text).toBe('Success');
170
171
  });
171
172
  });
172
173
  });