@t8/docsgen 0.4.20 → 0.4.21
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/bin.js
CHANGED
|
@@ -445,11 +445,17 @@ function getSectionPostprocess(linkMap) {
|
|
|
445
445
|
for (let a of document.querySelectorAll("a")) {
|
|
446
446
|
let href = a.getAttribute("href");
|
|
447
447
|
if (href === null) continue;
|
|
448
|
-
if (isPreviewURL(href)
|
|
448
|
+
if (isPreviewURL(href)) {
|
|
449
449
|
let preview = document.createElement("fieldset");
|
|
450
450
|
preview.innerHTML = getPreviewContent(href, a.innerHTML);
|
|
451
|
-
a.
|
|
452
|
-
|
|
451
|
+
let p = a.closest("p");
|
|
452
|
+
if (p?.parentElement) {
|
|
453
|
+
p.parentElement.insertBefore(preview, p);
|
|
454
|
+
if (a.nextElementSibling?.matches("br"))
|
|
455
|
+
a.nextElementSibling.remove();
|
|
456
|
+
a.remove();
|
|
457
|
+
if (p.innerHTML.trim() === "") p.remove();
|
|
458
|
+
}
|
|
453
459
|
} else {
|
|
454
460
|
let nextHref = linkMap[href] ?? href;
|
|
455
461
|
a.setAttribute("href", nextHref);
|
package/dist/css/section.css
CHANGED
package/package.json
CHANGED
|
@@ -32,13 +32,23 @@ export function getSectionPostprocess(
|
|
|
32
32
|
|
|
33
33
|
if (href === null) continue;
|
|
34
34
|
|
|
35
|
-
if (isPreviewURL(href)
|
|
35
|
+
if (isPreviewURL(href)) {
|
|
36
36
|
let preview = document.createElement("fieldset");
|
|
37
37
|
|
|
38
38
|
preview.innerHTML = getPreviewContent(href, a.innerHTML);
|
|
39
39
|
|
|
40
|
-
a.
|
|
41
|
-
|
|
40
|
+
let p = a.closest("p");
|
|
41
|
+
|
|
42
|
+
if (p?.parentElement) {
|
|
43
|
+
p.parentElement.insertBefore(preview, p);
|
|
44
|
+
|
|
45
|
+
if (a.nextElementSibling?.matches("br"))
|
|
46
|
+
a.nextElementSibling.remove();
|
|
47
|
+
|
|
48
|
+
a.remove();
|
|
49
|
+
|
|
50
|
+
if (p.innerHTML.trim() === "") p.remove();
|
|
51
|
+
}
|
|
42
52
|
} else {
|
|
43
53
|
let nextHref = linkMap[href] ?? href;
|
|
44
54
|
|