@socialgouv/fiches-travail-data-types 4.730.0 → 4.732.0
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.
|
@@ -257,14 +257,14 @@ const getDate = (article) => {
|
|
|
257
257
|
}
|
|
258
258
|
throw new Error("Can't find the updated date in the first paragraph");
|
|
259
259
|
};
|
|
260
|
-
const populateSections = (sections) => {
|
|
260
|
+
const populateSections = (sections, title) => {
|
|
261
261
|
return sections.map((section) => ({
|
|
262
262
|
anchor: (0, cdtn_slugify_1.default)(section.title),
|
|
263
263
|
description: section.text.slice(0, 200),
|
|
264
264
|
html: section.html,
|
|
265
265
|
references: getReferences(section.text),
|
|
266
266
|
text: section.text,
|
|
267
|
-
title: section.title,
|
|
267
|
+
title: section.title === "" ? title : section.title,
|
|
268
268
|
}));
|
|
269
269
|
};
|
|
270
270
|
function parseDom(dom, id, url) {
|
|
@@ -319,7 +319,7 @@ function parseDom(dom, id, url) {
|
|
|
319
319
|
description,
|
|
320
320
|
intro,
|
|
321
321
|
pubId: id,
|
|
322
|
-
sections: populateSections(sections),
|
|
322
|
+
sections: populateSections(sections, title),
|
|
323
323
|
title,
|
|
324
324
|
url,
|
|
325
325
|
};
|