@rr0/cms 0.3.76 → 0.3.77

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.
@@ -53,12 +53,13 @@ export class TimeElementFactory {
53
53
  return replacement;
54
54
  }
55
55
  createStarting(fromContext, previousContext, options) {
56
+ options = { ...options, relativeWords: false }; // Not "à partir de l'année suivante"
56
57
  const { result, replacement } = this.renderer.renderContent(fromContext, previousContext, options);
57
58
  let startingReplacement;
58
59
  startingReplacement = fromContext.file.document.createElement("span");
59
60
  startingReplacement.className = "time-interval";
60
61
  const approximate = !fromContext.time.getDayOfMonth();
61
- startingReplacement.innerHTML = fromContext.messages.context.time.starting(approximate) + " " + result.outerHTML;
62
+ startingReplacement.textContent = fromContext.messages.context.time.starting(approximate);
62
63
  result.append(startingReplacement, replacement);
63
64
  return result;
64
65
  }
@@ -236,6 +236,10 @@ describe("TimeReplacer", async () => {
236
236
  test("but not without one", async () => {
237
237
  expect(await renderAfter("fr", "<time>2005</time>. Puis, <time>2006</time>")).toBe("l'année suivante");
238
238
  });
239
+ test("including the one of an open interval", async () => {
240
+ expect(await renderAfter("fr", "<time>2005</time>. <time>2006/</time>")).toBe("à partir de 2006");
241
+ expect(await renderAfter("en", "<time>2005</time>. <time>2006/</time>")).toBe("starting 2006");
242
+ });
239
243
  });
240
244
  test("avoids linking to current file", async () => {
241
245
  const context = cmsTestUtil.time.newHtmlContext("1/9/9/0/08/index.html", "");
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@rr0/cms",
3
3
  "type": "module",
4
4
  "author": "Jérôme Beau <rr0@rr0.org> (https://rr0.org)",
5
- "version": "0.3.76",
5
+ "version": "0.3.77",
6
6
  "description": "RR0 Content Management System (CMS)",
7
7
  "exports": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",