@rr0/cms 0.3.39 → 0.3.40
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.
|
@@ -58,7 +58,7 @@ export class DataContentVisitor {
|
|
|
58
58
|
const eventTime = eventContext.time.date = event.time;
|
|
59
59
|
assert.ok(eventTime, `Event of type "${event.type}" has no time for paragraph`);
|
|
60
60
|
container.dataset.time = eventTime.toString();
|
|
61
|
-
const timeEl = this.timeElementFactory.create(eventContext, context);
|
|
61
|
+
const timeEl = this.timeElementFactory.create(eventContext, context, { url: true, contentOnly: false });
|
|
62
62
|
return { eventP: container, timeEl };
|
|
63
63
|
}
|
|
64
64
|
async processImage(context, imageData) {
|
|
@@ -128,7 +128,7 @@ export class DataContentVisitor {
|
|
|
128
128
|
const bookEl = doc.createElement("p");
|
|
129
129
|
const people = context.people;
|
|
130
130
|
const birthContext = context.clone();
|
|
131
|
-
const bookDateEl = this.timeElementFactory.create(birthContext, context);
|
|
131
|
+
const bookDateEl = this.timeElementFactory.create(birthContext, context, { url: true, contentOnly: false });
|
|
132
132
|
bookEl.append(bookDateEl, " ");
|
|
133
133
|
bookEl.append((people.gender === "female" ? "elle" : "il") + " écrit un livre");
|
|
134
134
|
await this.eventRenderer.renderEnd(context, bookData, bookEl);
|
|
@@ -6,7 +6,7 @@ import { TimeRenderer, TimeRenderOptions } from "./TimeRenderer.js";
|
|
|
6
6
|
export declare class TimeElementFactory {
|
|
7
7
|
readonly renderer: TimeRenderer;
|
|
8
8
|
constructor(renderer: TimeRenderer);
|
|
9
|
-
create(context: HtmlRR0Context, previousContext: HtmlRR0Context | undefined, options
|
|
9
|
+
create(context: HtmlRR0Context, previousContext: HtmlRR0Context | undefined, options: TimeRenderOptions): HTMLElement | undefined;
|
|
10
10
|
protected createInterval(fromContext: HtmlRR0Context, toContext: HtmlRR0Context, previousContext: HtmlRR0Context, options: TimeRenderOptions): HTMLElement | undefined;
|
|
11
11
|
protected createStarting(fromContext: HtmlRR0Context, previousContext: HtmlRR0Context, options: TimeRenderOptions): HTMLElement | undefined;
|
|
12
12
|
protected valueReplacement(context: HtmlRR0Context, previousContext: RR0Context | undefined, options?: TimeRenderOptions): HTMLElement | undefined;
|
|
@@ -6,7 +6,7 @@ export class TimeElementFactory {
|
|
|
6
6
|
constructor(renderer) {
|
|
7
7
|
this.renderer = renderer;
|
|
8
8
|
}
|
|
9
|
-
create(context, previousContext, options
|
|
9
|
+
create(context, previousContext, options) {
|
|
10
10
|
let replacement;
|
|
11
11
|
const time = context.time;
|
|
12
12
|
const interval = time.interval;
|
|
@@ -20,7 +20,7 @@ export class TimeReplacer {
|
|
|
20
20
|
const previousContext = origEl.dataset.context === "none" ? undefined : context.clone();
|
|
21
21
|
const timeStr = origEl.textContent;
|
|
22
22
|
const valid = context.time.updateFromStr(timeStr);
|
|
23
|
-
replacement = valid && this.factory.create(context, previousContext);
|
|
23
|
+
replacement = valid && this.factory.create(context, previousContext, { url: true, contentOnly: true });
|
|
24
24
|
if (!replacement) {
|
|
25
25
|
replacement = origEl;
|
|
26
26
|
// replacement.setAttribute("datetime", context.time.toString())
|
package/package.json
CHANGED