pretty-toc 1.3.7 → 1.3.8
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/README.md +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ satteri({
|
|
|
47
47
|
})
|
|
48
48
|
|
|
49
49
|
// Full example
|
|
50
|
-
|
|
50
|
+
satteri({
|
|
51
51
|
hastPlugins: [
|
|
52
52
|
prettyToc({
|
|
53
53
|
title: "Table of Contents",
|
|
@@ -109,7 +109,7 @@ processor: satteri({
|
|
|
109
109
|
## Screenshots
|
|
110
110
|
|
|
111
111
|
<details>
|
|
112
|
-
<summary
|
|
112
|
+
<summary>Click to open</summary>
|
|
113
113
|
<ol>
|
|
114
114
|
<li>
|
|
115
115
|
<p>icon</p>
|
package/dist/index.mjs
CHANGED
|
@@ -88,7 +88,7 @@ function prettyToc(option) {
|
|
|
88
88
|
try {
|
|
89
89
|
const depth = parseInt(node.tagName.slice(-1), 10);
|
|
90
90
|
const content = ctx.textContent(node);
|
|
91
|
-
const contentSlug = slug(content) +
|
|
91
|
+
const contentSlug = slug(content) + "-" + crypto.randomUUID();
|
|
92
92
|
if (opt.languageMap) title = opt.languageMap[opt.locale ?? "en-US"] || "Table of Contents";
|
|
93
93
|
else title = DEFAULT_LANGUAGE_MAP[opt.locale ?? "en-US"] || "Table of Contents";
|
|
94
94
|
if (opt.listStyle === "icon" || opt.listStyle === "image" || opt.listStyle === "decimal") listStyle = "none";
|
|
@@ -320,7 +320,7 @@ function prettyToc(option) {
|
|
|
320
320
|
<body>
|
|
321
321
|
<script is:inline data-astro-rerun>
|
|
322
322
|
const currentLocale = window.parent.location.pathname.split('/')[1] || '${opt.locale || "en-US"}';
|
|
323
|
-
const languageMap = ${JSON.stringify(opt.languageMap).replaceAll("\"", "'")
|
|
323
|
+
const languageMap = ${opt.languageMap ? JSON.stringify(opt.languageMap).replaceAll("\"", "'") : JSON.stringify(DEFAULT_LANGUAGE_MAP).replaceAll("\"", "'")};
|
|
324
324
|
|
|
325
325
|
function syncTocTitle(
|
|
326
326
|
locale,
|