@tricoteuses/tisseuse 0.17.0 → 0.17.1
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.
- package/dist/server.js +19 -7
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1359,15 +1359,27 @@ function dn(e, t) {
|
|
|
1359
1359
|
if (!n.includes("«") || !n.includes("»") || e(t).find("table").length > 0) return;
|
|
1360
1360
|
let r = e(t).find("tr").get().filter((n) => e(n).closest("table").get(0) === t);
|
|
1361
1361
|
if (r.length === 0) return;
|
|
1362
|
-
let i = r.map((t) => {
|
|
1363
|
-
let
|
|
1364
|
-
|
|
1362
|
+
let i = 0, a = 0, o = r.map((t, n) => {
|
|
1363
|
+
let o = e(t).children("td,th").get(), s = i === 0, c = a === 0;
|
|
1364
|
+
if (i > 0 && i--, a > 0 && a--, o.length < 1 + Number(s) + Number(c)) return [];
|
|
1365
|
+
let l = s ? o[0] : void 0, u = c ? o.at(-1) : void 0;
|
|
1366
|
+
if (l) {
|
|
1367
|
+
let t = Number(e(l).attr("rowspan") ?? "1");
|
|
1368
|
+
if (!Number.isInteger(t) || t < 1 || t > r.length - n || t > 1 && M(e(l).text()) !== "«") return [];
|
|
1369
|
+
i = t - 1;
|
|
1370
|
+
}
|
|
1371
|
+
if (u) {
|
|
1372
|
+
let t = Number(e(u).attr("rowspan") ?? "1");
|
|
1373
|
+
if (!Number.isInteger(t) || t < 1 || t > r.length - n || t > 1 && !/^»\s*;?$/u.test(M(e(u).text()))) return [];
|
|
1374
|
+
a = t - 1;
|
|
1375
|
+
}
|
|
1376
|
+
return [l, u];
|
|
1365
1377
|
});
|
|
1366
|
-
if (
|
|
1367
|
-
let
|
|
1368
|
-
if (!(
|
|
1378
|
+
if (o.some((e) => e.length !== 2)) return;
|
|
1379
|
+
let s = o.map(([t]) => t ? M(e(t).text()) : ""), c = o.map(([, t]) => t ? M(e(t).text()) : "");
|
|
1380
|
+
if (!(s.filter((e) => e === "«").length !== 1 || c.filter((e) => /^»\s*;?$/u.test(e)).length !== 1 || s.some((e) => e !== "" && e !== "«") || c.some((e) => e !== "" && !/^»\s*;?$/u.test(e)) || o.some(([t, n]) => [t, n].some((t) => t && e(t).attr("colspan") !== void 0))) && !(s.indexOf("«") > c.findIndex((e) => e.startsWith("»")))) {
|
|
1369
1381
|
e(t).addClass("akn-quoted-table");
|
|
1370
|
-
for (let [t, n] of
|
|
1382
|
+
for (let [t, n] of o) t && e(t).addClass("akn-quote-column"), n && e(n).addClass("akn-quote-column");
|
|
1371
1383
|
}
|
|
1372
1384
|
}
|
|
1373
1385
|
function fn(e, t) {
|