@weborigami/origami 0.2.9 → 0.2.10
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/package.json +5 -5
- package/src/text/mdHtml.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weborigami/origami",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "Web Origami language, CLI, framework, and server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"main": "./main.js",
|
|
14
14
|
"types": "./index.ts",
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@types/node": "22.13.
|
|
16
|
+
"@types/node": "22.13.13",
|
|
17
17
|
"typescript": "5.8.2"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@weborigami/async-tree": "0.2.
|
|
21
|
-
"@weborigami/language": "0.2.
|
|
22
|
-
"@weborigami/types": "0.2.
|
|
20
|
+
"@weborigami/async-tree": "0.2.10",
|
|
21
|
+
"@weborigami/language": "0.2.10",
|
|
22
|
+
"@weborigami/types": "0.2.10",
|
|
23
23
|
"exif-parser": "0.1.12",
|
|
24
24
|
"graphviz-wasm": "3.0.2",
|
|
25
25
|
"highlight.js": "11.11.1",
|
package/src/text/mdHtml.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { extension, isUnpackable } from "@weborigami/async-tree";
|
|
2
2
|
import highlight from "highlight.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Marked } from "marked";
|
|
4
4
|
import { gfmHeadingId as markedGfmHeadingId } from "marked-gfm-heading-id";
|
|
5
5
|
import { markedHighlight } from "marked-highlight";
|
|
6
6
|
import { markedSmartypants } from "marked-smartypants";
|
|
@@ -10,6 +10,8 @@ import origamiHighlightDefinition from "./origamiHighlightDefinition.js";
|
|
|
10
10
|
|
|
11
11
|
highlight.registerLanguage("ori", origamiHighlightDefinition);
|
|
12
12
|
|
|
13
|
+
// Create our own marked instance so we don't interfere with the global one
|
|
14
|
+
const marked = new Marked();
|
|
13
15
|
marked.use(
|
|
14
16
|
// @ts-ignore
|
|
15
17
|
markedGfmHeadingId(),
|
|
@@ -24,8 +26,6 @@ marked.use(
|
|
|
24
26
|
markedSmartypants(),
|
|
25
27
|
{
|
|
26
28
|
gfm: true, // Use GitHub-flavored markdown.
|
|
27
|
-
// @ts-ignore
|
|
28
|
-
mangle: false,
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
31
|
|
|
@@ -52,7 +52,7 @@ export default async function mdHtml(input) {
|
|
|
52
52
|
if (markdown === null) {
|
|
53
53
|
throw new Error("mdHtml: The provided input couldn't be treated as text.");
|
|
54
54
|
}
|
|
55
|
-
const html = marked(markdown);
|
|
55
|
+
const html = marked.parse(markdown);
|
|
56
56
|
return inputIsDocument ? documentObject(html, input) : html;
|
|
57
57
|
}
|
|
58
58
|
|