@hyperbook/markdown 0.11.0 → 0.11.2
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.
|
@@ -12,7 +12,15 @@ hyperbook.mermaid = (function () {
|
|
|
12
12
|
els.forEach((element) => {
|
|
13
13
|
if (element.getAttribute("data-mermaid") != null) {
|
|
14
14
|
element.removeAttribute("data-processed");
|
|
15
|
-
|
|
15
|
+
const data = atob(element.getAttribute("data-mermaid"));
|
|
16
|
+
const escapedData = data
|
|
17
|
+
.replace(/&/g, "&")
|
|
18
|
+
.replace(/</g, "<")
|
|
19
|
+
.replace(/>/g, ">")
|
|
20
|
+
.replace(/"/g, """)
|
|
21
|
+
.replace(/'/g, "'");
|
|
22
|
+
element.innerHTML = escapedData;
|
|
23
|
+
console.log(element.innerHTML);
|
|
16
24
|
}
|
|
17
25
|
count--;
|
|
18
26
|
if (count == 0) {
|
package/dist/index.js
CHANGED
|
@@ -64243,7 +64243,7 @@ var rehypeHtmlStructure_default = (ctx) => () => {
|
|
|
64243
64243
|
children: [
|
|
64244
64244
|
{
|
|
64245
64245
|
type: "text",
|
|
64246
|
-
value: `${currentPage?.name} - ${config2.name}`
|
|
64246
|
+
value: currentPage?.name ? `${currentPage?.name} - ${config2.name}` : config2.name
|
|
64247
64247
|
}
|
|
64248
64248
|
]
|
|
64249
64249
|
},
|
|
@@ -64252,7 +64252,7 @@ var rehypeHtmlStructure_default = (ctx) => () => {
|
|
|
64252
64252
|
tagName: "meta",
|
|
64253
64253
|
properties: {
|
|
64254
64254
|
property: "og:title",
|
|
64255
|
-
|
|
64255
|
+
value: currentPage?.name ? `${currentPage?.name} - ${config2.name}` : config2.name
|
|
64256
64256
|
},
|
|
64257
64257
|
children: []
|
|
64258
64258
|
},
|
|
@@ -66045,12 +66045,12 @@ var remarkDirectiveMermaid_default = (ctx) => () => {
|
|
|
66045
66045
|
["mermaid.min.js", "client.js"],
|
|
66046
66046
|
["style.css"]
|
|
66047
66047
|
);
|
|
66048
|
-
const value =
|
|
66048
|
+
const value = node2.value || toString2(node2.children);
|
|
66049
66049
|
const {} = node2.attributes || {};
|
|
66050
66050
|
data.hName = "pre";
|
|
66051
66051
|
data.hProperties = {
|
|
66052
66052
|
class: "directive-mermaid mermaid",
|
|
66053
|
-
"data-mermaid": value
|
|
66053
|
+
"data-mermaid": Buffer.from(value).toString("base64")
|
|
66054
66054
|
};
|
|
66055
66055
|
data.hChildren = [
|
|
66056
66056
|
{
|