hdoc-tools 0.41.0 → 0.41.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.
- package/hdoc-build.js +8 -3
- package/hdoc-serve.js +1 -1
- package/package.json +1 -1
package/hdoc-build.js
CHANGED
@@ -520,7 +520,8 @@
|
|
520
520
|
linkify: true,
|
521
521
|
typographer: true,
|
522
522
|
highlight: function (str, lang) {
|
523
|
-
|
523
|
+
|
524
|
+
if (lang === "mermaid" && process.env.GITHUB_ACTIONS !== 'true') {
|
524
525
|
try {
|
525
526
|
const tmpInput = tmp.fileSync({ postfix: ".mmd" });
|
526
527
|
const tmpOutput = tmp.fileSync({ postfix: ".svg" });
|
@@ -530,8 +531,12 @@
|
|
530
531
|
}
|
531
532
|
|
532
533
|
fs.writeFileSync(tmpInput.name, str);
|
533
|
-
|
534
|
-
|
534
|
+
let cmd = `${__dirname}/node_modules/.bin/mmdc`;
|
535
|
+
|
536
|
+
if (process.platform === "win32") {
|
537
|
+
cmd = `"${cmd}"`;
|
538
|
+
}
|
539
|
+
cmd = `${cmd} -i "${tmpInput.name}" -o "${tmpOutput.name}" --quiet --backgroundColor transparent`;
|
535
540
|
console.log(`Generating Inline Mermaid SVG found in: ${file_path.relativePath}`);
|
536
541
|
execSync(cmd);
|
537
542
|
|
package/hdoc-serve.js
CHANGED
@@ -143,7 +143,7 @@
|
|
143
143
|
|
144
144
|
fs.writeFileSync(tmpInput.name, str);
|
145
145
|
|
146
|
-
const cmd = `${__dirname}/node_modules/.bin/mmdc -i "${tmpInput.name}" -o "${tmpOutput.name}" --quiet --backgroundColor transparent
|
146
|
+
const cmd = `${__dirname}/node_modules/.bin/mmdc -i "${tmpInput.name}" -o "${tmpOutput.name}" --quiet --backgroundColor transparent`;
|
147
147
|
console.log(`Generating Inline Mermaid SVG found in: ${file_path}`);
|
148
148
|
execSync(cmd);
|
149
149
|
|