@rohal12/twee-ts 1.13.0 → 1.13.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.
@@ -4361,10 +4361,12 @@ function toTwine2Archive(story, startName, options) {
4361
4361
  function toTwine2HTML(story, format, startName, options) {
4362
4362
  let template = readFormatSource(format);
4363
4363
  if (template.includes("{{STORY_NAME}}")) {
4364
- template = template.replaceAll("{{STORY_NAME}}", htmlEscape(story.name));
4364
+ const name = htmlEscape(story.name);
4365
+ template = template.replaceAll("{{STORY_NAME}}", () => name);
4365
4366
  }
4366
4367
  if (template.includes("{{STORY_DATA}}")) {
4367
- template = template.replace("{{STORY_DATA}}", getTwine2DataChunk(story, startName, options));
4368
+ const data = getTwine2DataChunk(story, startName, options);
4369
+ template = template.replace("{{STORY_DATA}}", () => data);
4368
4370
  }
4369
4371
  return template;
4370
4372
  }
@@ -4465,10 +4467,11 @@ function toTwine1HTML(story, format, startName) {
4465
4467
  const displayStart = startName === "Start" ? "" : startName;
4466
4468
  template = template.replace('"VERSION"', `Compiled with ${CREATOR_NAME2}, ${VERSION}`);
4467
4469
  template = template.replace('"TIME"', `Built on ${(/* @__PURE__ */ new Date()).toUTCString()}`);
4468
- template = template.replace('"START_AT"', `"${jsStringEscape(displayStart)}"`);
4470
+ const startAtValue = `"${jsStringEscape(displayStart)}"`;
4471
+ template = template.replace('"START_AT"', () => startAtValue);
4469
4472
  template = template.replace('"STORY_SIZE"', `"${count}"`);
4470
4473
  if (template.includes('"STORY"')) {
4471
- template = template.replace('"STORY"', data);
4474
+ template = template.replace('"STORY"', () => data);
4472
4475
  } else {
4473
4476
  let footer;
4474
4477
  try {
@@ -4504,7 +4507,7 @@ function tryReplaceComponent(template, placeholder, componentPath, required) {
4504
4507
  try {
4505
4508
  let content = readFileSync2(componentPath, "utf-8");
4506
4509
  if (content.charCodeAt(0) === 65279) content = content.slice(1);
4507
- return template.replace(placeholder, content);
4510
+ return template.replace(placeholder, () => content);
4508
4511
  } catch (e) {
4509
4512
  if (required) {
4510
4513
  throw new Error(
@@ -4592,7 +4595,8 @@ function modifyHead(html, modulePaths, headFile, diagnostics) {
4592
4595
  }
4593
4596
  if (parts.length > 0) {
4594
4597
  parts.push("</head>");
4595
- return html.replace("</head>", parts.join("\n"));
4598
+ const replacement = parts.join("\n");
4599
+ return html.replace("</head>", () => replacement);
4596
4600
  }
4597
4601
  return html;
4598
4602
  }
@@ -4996,4 +5000,4 @@ export {
4996
5000
  compile,
4997
5001
  compileIncremental
4998
5002
  };
4999
- //# sourceMappingURL=chunk-ORMESTR7.js.map
5003
+ //# sourceMappingURL=chunk-EQAUFATA.js.map