@tricoteuses/tisseuse 0.13.10 → 0.13.11

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.
Files changed (2) hide show
  1. package/dist/server.js +15 -2
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -247,7 +247,7 @@ function ge(e, t) {
247
247
  }
248
248
  function P(e) {
249
249
  let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
250
- return e("a[id], span[id], h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").each((i, a) => {
250
+ e("a[id], span[id], h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").each((i, a) => {
251
251
  let o = M(E(e(a).text()));
252
252
  if (!o) return;
253
253
  let s = e(a).attr("id");
@@ -259,7 +259,20 @@ function P(e) {
259
259
  element: a,
260
260
  container: c
261
261
  }));
262
- }), t;
262
+ }), e("h1:not([id]), h2:not([id]), h3:not([id]), h4:not([id]), h5:not([id]), h6:not([id])").each((i, a) => {
263
+ if (n.has(a)) return;
264
+ let o = M(E(e(a).text()));
265
+ if (!o) return;
266
+ let s = `_TocArt${(o.num ?? o.label.replace(/^Article\s+/iu, "")).replace(/\s+/gu, "")}`;
267
+ r.has(s) || (r.add(s), n.add(a), t.push({
268
+ id: s,
269
+ ...o,
270
+ element: a,
271
+ container: a
272
+ }));
273
+ });
274
+ let i = e("body *");
275
+ return t.sort((e, t) => i.index(e.container) - i.index(t.container)), t;
263
276
  }
264
277
  function F(e) {
265
278
  let t = e.next;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tricoteuses/tisseuse",
3
3
  "description": "Find links in/to French legislative documents",
4
- "version": "0.13.10",
4
+ "version": "0.13.11",
5
5
  "keywords": [
6
6
  "Assemblée nationale",
7
7
  "France",