Skip to content

Commit ec75d81

Browse files
committed
Add id and remove children from flourish transformer
1 parent 924aec9 commit ec75d81

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

libraries/from-bodyxml/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,20 +257,23 @@ export let defaultTransformers = {
257257
* @type {Transformer<ContentTree.transit.Flourish | ContentTree.transit.Link>}
258258
*/
259259
[ContentType.content](content) {
260+
const id = content.attributes.url ?? "";
261+
const uuid = id.split("/").pop();
262+
260263
if (content.attributes["data-asset-type"] == "flourish") {
261264
return /** @type {ContentTree.transit.Flourish} */ ({
262265
type: "flourish",
266+
id: uuid,
263267
flourishType: content.attributes["data-flourish-type"] || "",
264268
layoutWidth: toValidLayoutWidth(
265269
content.attributes["data-layout-width"] || ""
266270
),
267271
description: content.attributes["alt"] || "",
268272
timestamp: content.attributes["data-time-stamp"] || "",
269-
// fallbackImage -- TODO should this be external in content-tree?
273+
children: null,
270274
});
271275
}
272-
const id = content.attributes.url ?? "";
273-
const uuid = id.split("/").pop();
276+
274277
return /** @type {ContentTree.transit.Link} */ ({
275278
type: "link",
276279
url: `https://www.ft.com/content/${uuid}`,

0 commit comments

Comments
 (0)