@scalar/code-highlight 0.0.28 → 0.0.29
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/CHANGELOG.md +6 -0
- package/dist/code/highlight.js +37 -59
- package/dist/code/highlight.js.map +7 -0
- package/dist/code/highlight.test.js +64 -0
- package/dist/code/highlight.test.js.map +7 -0
- package/dist/code/index.js +5 -1
- package/dist/code/index.js.map +7 -0
- package/dist/code/line-numbers.js +54 -75
- package/dist/code/line-numbers.js.map +7 -0
- package/dist/constants.js +11 -11
- package/dist/constants.js.map +7 -0
- package/dist/index.js +12 -7
- package/dist/index.js.map +7 -0
- package/dist/languages/basic.js +31 -30
- package/dist/languages/basic.js.map +7 -0
- package/dist/languages/index.js +9 -3
- package/dist/languages/index.js.map +7 -0
- package/dist/languages/json-yaml.js +10 -9
- package/dist/languages/json-yaml.js.map +7 -0
- package/dist/languages/standard.js +77 -76
- package/dist/languages/standard.js.map +7 -0
- package/dist/markdown/getHeadings.test.js +45 -0
- package/dist/markdown/getHeadings.test.js.map +7 -0
- package/dist/markdown/htmlFromMarkdown.test.js +41 -0
- package/dist/markdown/htmlFromMarkdown.test.js.map +7 -0
- package/dist/markdown/index.js +2 -1
- package/dist/markdown/index.js.map +7 -0
- package/dist/markdown/markdown.js +94 -142
- package/dist/markdown/markdown.js.map +7 -0
- package/dist/markdown/splitContent.test.js +17 -0
- package/dist/markdown/splitContent.test.js.map +7 -0
- package/dist/rehype-alert/index.js +5 -1
- package/dist/rehype-alert/index.js.map +7 -0
- package/dist/rehype-alert/rehype-alert.js +84 -95
- package/dist/rehype-alert/rehype-alert.js.map +7 -0
- package/dist/rehype-alert/rehype-alert.test.js +74 -0
- package/dist/rehype-alert/rehype-alert.test.js.map +7 -0
- package/dist/rehype-highlight/index.js +5 -1
- package/dist/rehype-highlight/index.js.map +7 -0
- package/dist/rehype-highlight/rehype-highlight.js +84 -95
- package/dist/rehype-highlight/rehype-highlight.js.map +7 -0
- package/package.json +4 -4
|
@@ -1,99 +1,88 @@
|
|
|
1
|
-
import { visit } from
|
|
2
|
-
|
|
3
|
-
const ALERT_TYPES = ['note', 'tip', 'important', 'warning', 'caution', 'success'];
|
|
4
|
-
// Simple whitespace check function
|
|
1
|
+
import { visit } from "unist-util-visit";
|
|
2
|
+
const ALERT_TYPES = ["note", "tip", "important", "warning", "caution", "success"];
|
|
5
3
|
function isWhitespace(node) {
|
|
6
|
-
|
|
4
|
+
return node.type === "text" && typeof node.value === "string" && /^\s*$/.test(node.value);
|
|
7
5
|
}
|
|
8
6
|
function rehypeAlert() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
children: [
|
|
87
|
-
{
|
|
88
|
-
type: 'element',
|
|
89
|
-
tagName: 'div',
|
|
90
|
-
properties: { className: ['markdown-alert-content'] },
|
|
91
|
-
children: [{ type: 'text', value: ' ' }, ...contentChildren],
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
};
|
|
95
|
-
});
|
|
96
|
-
};
|
|
7
|
+
return (tree) => {
|
|
8
|
+
visit(tree, "element", (node, index, parent) => {
|
|
9
|
+
if (node.tagName !== "blockquote" || typeof index !== "number" || !parent || parent.type !== "root") {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const headIndex = node.children.findIndex((child) => !isWhitespace(child));
|
|
13
|
+
if (headIndex === -1) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const head = node.children[headIndex];
|
|
17
|
+
if (!head || head.type !== "element" || head.tagName !== "p") {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const text = head.children[0];
|
|
21
|
+
if (!text || text.type !== "text" || !text.value.startsWith("[!")) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const end = text.value.indexOf("]");
|
|
25
|
+
if (end === -1) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const alertType = text.value.slice(2, end).toLowerCase();
|
|
29
|
+
if (!ALERT_TYPES.includes(alertType)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (end + 1 === text.value.length) {
|
|
33
|
+
const next = head.children[1];
|
|
34
|
+
if (next) {
|
|
35
|
+
if (next.type !== "element" || next.tagName !== "br") {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (!head.children[2]) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
head.children = head.children.slice(2);
|
|
42
|
+
const node2 = head.children[0];
|
|
43
|
+
if (node2 && node2.type === "text" && node2.value.charAt(0) === "\n") {
|
|
44
|
+
node2.value = node2.value.slice(1);
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
const skipped = headIndex + 1 < node.children.length && isWhitespace(node.children[headIndex + 1]);
|
|
48
|
+
const nextIndex = skipped ? headIndex + 2 : headIndex + 1;
|
|
49
|
+
if (nextIndex >= node.children.length || node.children[nextIndex].type !== "element") {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
node.children = node.children.slice(nextIndex);
|
|
53
|
+
}
|
|
54
|
+
} else if (text.value.charAt(end + 1) === "\n" && // Check if the next character is a newline or a non-whitespace character
|
|
55
|
+
(end + 2 === text.value.length || !/^\s*$/.test(text.value.slice(end + 2)))) {
|
|
56
|
+
text.value = text.value.slice(end + 2);
|
|
57
|
+
} else {
|
|
58
|
+
text.value = text.value.replace(/^\s*\[!.*?\]\s*/, "");
|
|
59
|
+
}
|
|
60
|
+
const contentChildren = [];
|
|
61
|
+
for (let i = headIndex; i < node.children.length; i++) {
|
|
62
|
+
const child = node.children[i];
|
|
63
|
+
if (child.type === "element" && child.tagName === "p" && child.children) {
|
|
64
|
+
contentChildren.push(...child.children);
|
|
65
|
+
} else {
|
|
66
|
+
contentChildren.push(child);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
parent.children[index] = {
|
|
70
|
+
type: "element",
|
|
71
|
+
tagName: "div",
|
|
72
|
+
properties: { className: ["markdown-alert", `markdown-alert-${alertType}`] },
|
|
73
|
+
children: [
|
|
74
|
+
{
|
|
75
|
+
type: "element",
|
|
76
|
+
tagName: "div",
|
|
77
|
+
properties: { className: ["markdown-alert-content"] },
|
|
78
|
+
children: [{ type: "text", value: " " }, ...contentChildren]
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
};
|
|
97
84
|
}
|
|
98
|
-
|
|
99
|
-
|
|
85
|
+
export {
|
|
86
|
+
rehypeAlert
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=rehype-alert.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/rehype-alert/rehype-alert.ts"],
|
|
4
|
+
"sourcesContent": ["import { visit } from 'unist-util-visit'\nimport type { Element } from 'hast'\nimport type { Root } from 'mdast'\n\nconst ALERT_TYPES = ['note', 'tip', 'important', 'warning', 'caution', 'success'] as const\n\n// Simple whitespace check function\nfunction isWhitespace(node: any): boolean {\n return node.type === 'text' && typeof node.value === 'string' && /^\\s*$/.test(node.value)\n}\n\nexport function rehypeAlert() {\n return (tree: Root) => {\n visit(tree, 'element', (node: Element, index, parent: any) => {\n if (node.tagName !== 'blockquote' || typeof index !== 'number' || !parent || parent.type !== 'root') {\n return\n }\n\n // Find the first non-whitespace child\n const headIndex = node.children.findIndex((child) => !isWhitespace(child))\n if (headIndex === -1) {\n return\n }\n\n const head = node.children[headIndex]\n\n if (!head || head.type !== 'element' || head.tagName !== 'p') {\n return\n }\n\n const text = head.children[0]\n if (!text || text.type !== 'text' || !text.value.startsWith('[!')) {\n return\n }\n\n const end = text.value.indexOf(']')\n if (end === -1) {\n return\n }\n\n // Extract the alert type\n const alertType = text.value.slice(2, end).toLowerCase() as (typeof ALERT_TYPES)[number]\n if (!ALERT_TYPES.includes(alertType)) {\n return\n }\n\n // Remove the blockquote if it's empty\n if (end + 1 === text.value.length) {\n const next = head.children[1]\n if (next) {\n if (next.type !== 'element' || next.tagName !== 'br') {\n return\n }\n if (!head.children[2]) {\n return\n }\n head.children = head.children.slice(2)\n const node = head.children[0]\n if (node && node.type === 'text' && node.value.charAt(0) === '\\n') {\n node.value = node.value.slice(1)\n }\n } else {\n const skipped = headIndex + 1 < node.children.length && isWhitespace(node.children[headIndex + 1])\n const nextIndex = skipped ? headIndex + 2 : headIndex + 1\n if (nextIndex >= node.children.length || node.children[nextIndex].type !== 'element') {\n return\n }\n\n node.children = node.children.slice(nextIndex)\n }\n } else if (\n text.value.charAt(end + 1) === '\\n' &&\n // Check if the next character is a newline or a non-whitespace character\n (end + 2 === text.value.length || !/^\\s*$/.test(text.value.slice(end + 2)))\n ) {\n text.value = text.value.slice(end + 2)\n } else {\n // Remove the alert marker if it\u2019s not followed by a newline or a non-whitespace character\n text.value = text.value.replace(/^\\s*\\[!.*?\\]\\s*/, '')\n }\n\n // Extract content from paragraphs to avoid wrapping in <p> tags\n const contentChildren = []\n for (let i = headIndex; i < node.children.length; i++) {\n const child = node.children[i]\n if (child.type === 'element' && child.tagName === 'p' && child.children) {\n contentChildren.push(...child.children)\n } else {\n contentChildren.push(child)\n }\n }\n\n // Replace the blockquote with a div containing the alert\n parent.children[index] = {\n type: 'element',\n tagName: 'div',\n properties: { className: ['markdown-alert', `markdown-alert-${alertType}`] },\n children: [\n {\n type: 'element',\n tagName: 'div',\n properties: { className: ['markdown-alert-content'] },\n children: [{ type: 'text', value: ' ' }, ...contentChildren],\n },\n ],\n }\n })\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,aAAa;AAItB,MAAM,cAAc,CAAC,QAAQ,OAAO,aAAa,WAAW,WAAW,SAAS;AAGhF,SAAS,aAAa,MAAoB;AACxC,SAAO,KAAK,SAAS,UAAU,OAAO,KAAK,UAAU,YAAY,QAAQ,KAAK,KAAK,KAAK;AAC1F;AAEO,SAAS,cAAc;AAC5B,SAAO,CAAC,SAAe;AACrB,UAAM,MAAM,WAAW,CAAC,MAAe,OAAO,WAAgB;AAC5D,UAAI,KAAK,YAAY,gBAAgB,OAAO,UAAU,YAAY,CAAC,UAAU,OAAO,SAAS,QAAQ;AACnG;AAAA,MACF;AAGA,YAAM,YAAY,KAAK,SAAS,UAAU,CAAC,UAAU,CAAC,aAAa,KAAK,CAAC;AACzE,UAAI,cAAc,IAAI;AACpB;AAAA,MACF;AAEA,YAAM,OAAO,KAAK,SAAS,SAAS;AAEpC,UAAI,CAAC,QAAQ,KAAK,SAAS,aAAa,KAAK,YAAY,KAA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AC,IACzE;AACA,aAAK,QAAQ,KAAK,MAAM,MAAM,MAAM,CAAC;AAAA,MACvC,OAAO;AAEL,aAAK,QAAQ,KAAK,MAAM,QAAQ,mBAAmB,EAAE;AAAA,MACvD;AAGA,YAAM,kBAAkB,CAAC;AACzB,eAAS,IAAI,WAAW,IAAI,KAAK,SAAS,QAAQ,KAAK;AACrD,cAAM,QAAQ,KAAK,SAAS,CAAC;AAC7B,YAAI,MAAM,SAAS,aAAa,MAAM,YAAY,OAAO,MAAM,UAAU;AACvE,0BAAgB,KAAK,GAAG,MAAM,QAAQ;AAAA,QACxC,OAAO;AACL,0BAAgB,KAAK,KAAK;AAAA,QAC5B;AAAA,MACF;AAGA,aAAO,SAAS,KAAK,IAAI;AAAA,QACvB,MAAM;AAAA,QACN,SAAS;AAAA,QACT,YAAY,EAAE,WAAW,CAAC,kBAAkB,kBAAkB,SAAS,EAAE,EAAE;AAAA,QAC3E,UAAU;AAAA,UACR;AAAA,YACE,MAAM;AAAA,YACN,SAAS;AAAA,YACT,YAAY,EAAE,WAAW,CAAC,wBAAwB,EAAE;AAAA,YACpD,UAAU,CAAC,EAAE,MAAM,QAAQ,OAAO,IAAI,GAAG,GAAG,eAAe;AAAA,UAC7D;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": ["node"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { unified } from "unified";
|
|
3
|
+
import remarkParse from "remark-parse";
|
|
4
|
+
import remarkRehype from "remark-rehype";
|
|
5
|
+
import rehypeStringify from "rehype-stringify";
|
|
6
|
+
import { rehypeAlert } from "./rehype-alert.js";
|
|
7
|
+
describe("rehype-alert", () => {
|
|
8
|
+
const process = async (markdown) => {
|
|
9
|
+
const file = await unified().use(remarkParse).use(remarkRehype, { allowDangerousHtml: true }).use(rehypeAlert).use(rehypeStringify).process(markdown);
|
|
10
|
+
return String(file);
|
|
11
|
+
};
|
|
12
|
+
it("transforms note alerts correctly", async () => {
|
|
13
|
+
const input = "> [!note]\n> This is a note callout.";
|
|
14
|
+
const output = await process(input);
|
|
15
|
+
expect(output).toContain('<div class="markdown-alert markdown-alert-note">');
|
|
16
|
+
expect(output).toContain('<div class="markdown-alert-content">');
|
|
17
|
+
expect(output).toContain("This is a note callout.");
|
|
18
|
+
});
|
|
19
|
+
it("transforms warning alerts correctly", async () => {
|
|
20
|
+
const input = "> [!warning]\n> This is a warning callout.";
|
|
21
|
+
const output = await process(input);
|
|
22
|
+
expect(output).toContain('<div class="markdown-alert markdown-alert-warning">');
|
|
23
|
+
expect(output).toContain("This is a warning callout.");
|
|
24
|
+
});
|
|
25
|
+
it("transforms caution alerts correctly", async () => {
|
|
26
|
+
const input = "> [!caution]\n> This is a caution callout.";
|
|
27
|
+
const output = await process(input);
|
|
28
|
+
expect(output).toContain('<div class="markdown-alert markdown-alert-caution">');
|
|
29
|
+
expect(output).toContain("This is a caution callout.");
|
|
30
|
+
});
|
|
31
|
+
it("transforms important alerts correctly", async () => {
|
|
32
|
+
const input = "> [!important]\n> This is an important callout.";
|
|
33
|
+
const output = await process(input);
|
|
34
|
+
expect(output).toContain('<div class="markdown-alert markdown-alert-important">');
|
|
35
|
+
expect(output).toContain("This is an important callout.");
|
|
36
|
+
});
|
|
37
|
+
it("transforms tip alerts correctly", async () => {
|
|
38
|
+
const input = "> [!tip]\n> This is a tip callout.";
|
|
39
|
+
const output = await process(input);
|
|
40
|
+
expect(output).toContain('<div class="markdown-alert markdown-alert-tip">');
|
|
41
|
+
expect(output).toContain("This is a tip callout.");
|
|
42
|
+
});
|
|
43
|
+
it("ignores blockquotes without alert syntax", async () => {
|
|
44
|
+
const input = "> This is a regular blockquote.";
|
|
45
|
+
const output = await process(input);
|
|
46
|
+
expect(output).not.toContain("markdown-alert");
|
|
47
|
+
expect(output).toContain("<blockquote>");
|
|
48
|
+
expect(output).toContain("This is a regular blockquote.");
|
|
49
|
+
});
|
|
50
|
+
it("ignores invalid alert types", async () => {
|
|
51
|
+
const input = "> [!invalid]\n> This is an invalid alert type.";
|
|
52
|
+
const output = await process(input);
|
|
53
|
+
expect(output).not.toContain("markdown-alert");
|
|
54
|
+
expect(output).toContain("<blockquote>");
|
|
55
|
+
expect(output).toContain("[!invalid]");
|
|
56
|
+
expect(output).toContain("This is an invalid alert type.");
|
|
57
|
+
});
|
|
58
|
+
it("handles multiline alert content correctly", async () => {
|
|
59
|
+
const input = "> [!note]\n> First line\n> Second line\n> Third line";
|
|
60
|
+
const output = await process(input);
|
|
61
|
+
expect(output).toContain('<div class="markdown-alert markdown-alert-note">');
|
|
62
|
+
expect(output).toContain("First line");
|
|
63
|
+
expect(output).toContain("Second line");
|
|
64
|
+
expect(output).toContain("Third line");
|
|
65
|
+
});
|
|
66
|
+
it("preserves HTML structure in alert content", async () => {
|
|
67
|
+
const input = "> [!note]\n> This is a note with **bold** and *italic* text.";
|
|
68
|
+
const output = await process(input);
|
|
69
|
+
expect(output).toContain('<div class="markdown-alert markdown-alert-note">');
|
|
70
|
+
expect(output).toContain("<strong>bold</strong>");
|
|
71
|
+
expect(output).toContain("<em>italic</em>");
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=rehype-alert.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/rehype-alert/rehype-alert.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { describe, expect, it } from 'vitest'\nimport { unified } from 'unified'\nimport remarkParse from 'remark-parse'\nimport remarkRehype from 'remark-rehype'\nimport rehypeStringify from 'rehype-stringify'\nimport { rehypeAlert } from './rehype-alert'\n\ndescribe('rehype-alert', () => {\n const process = async (markdown: string) => {\n const file = await unified()\n .use(remarkParse)\n .use(remarkRehype, { allowDangerousHtml: true })\n .use(rehypeAlert)\n .use(rehypeStringify)\n .process(markdown)\n\n return String(file)\n }\n\n it('transforms note alerts correctly', async () => {\n const input = '> [!note]\\n> This is a note callout.'\n const output = await process(input)\n\n expect(output).toContain('<div class=\"markdown-alert markdown-alert-note\">')\n expect(output).toContain('<div class=\"markdown-alert-content\">')\n expect(output).toContain('This is a note callout.')\n })\n\n it('transforms warning alerts correctly', async () => {\n const input = '> [!warning]\\n> This is a warning callout.'\n const output = await process(input)\n\n expect(output).toContain('<div class=\"markdown-alert markdown-alert-warning\">')\n expect(output).toContain('This is a warning callout.')\n })\n\n it('transforms caution alerts correctly', async () => {\n const input = '> [!caution]\\n> This is a caution callout.'\n const output = await process(input)\n\n expect(output).toContain('<div class=\"markdown-alert markdown-alert-caution\">')\n expect(output).toContain('This is a caution callout.')\n })\n\n it('transforms important alerts correctly', async () => {\n const input = '> [!important]\\n> This is an important callout.'\n const output = await process(input)\n\n expect(output).toContain('<div class=\"markdown-alert markdown-alert-important\">')\n expect(output).toContain('This is an important callout.')\n })\n\n it('transforms tip alerts correctly', async () => {\n const input = '> [!tip]\\n> This is a tip callout.'\n const output = await process(input)\n\n expect(output).toContain('<div class=\"markdown-alert markdown-alert-tip\">')\n expect(output).toContain('This is a tip callout.')\n })\n\n it('ignores blockquotes without alert syntax', async () => {\n const input = '> This is a regular blockquote.'\n const output = await process(input)\n\n expect(output).not.toContain('markdown-alert')\n expect(output).toContain('<blockquote>')\n expect(output).toContain('This is a regular blockquote.')\n })\n\n it('ignores invalid alert types', async () => {\n const input = '> [!invalid]\\n> This is an invalid alert type.'\n const output = await process(input)\n\n expect(output).not.toContain('markdown-alert')\n expect(output).toContain('<blockquote>')\n expect(output).toContain('[!invalid]')\n expect(output).toContain('This is an invalid alert type.')\n })\n\n it('handles multiline alert content correctly', async () => {\n const input = '> [!note]\\n> First line\\n> Second line\\n> Third line'\n const output = await process(input)\n\n expect(output).toContain('<div class=\"markdown-alert markdown-alert-note\">')\n expect(output).toContain('First line')\n expect(output).toContain('Second line')\n expect(output).toContain('Third line')\n })\n\n it('preserves HTML structure in alert content', async () => {\n const input = '> [!note]\\n> This is a note with **bold** and *italic* text.'\n const output = await process(input)\n\n expect(output).toContain('<div class=\"markdown-alert markdown-alert-note\">')\n expect(output).toContain('<strong>bold</strong>')\n expect(output).toContain('<em>italic</em>')\n })\n})\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AACrC,SAAS,eAAe;AACxB,OAAO,iBAAiB;AACxB,OAAO,kBAAkB;AACzB,OAAO,qBAAqB;AAC5B,SAAS,mBAAmB;AAE5B,SAAS,gBAAgB,MAAM;AAC7B,QAAM,UAAU,OAAO,aAAqB;AAC1C,UAAM,OAAO,MAAM,QAAQ,EACxB,IAAI,WAAW,EACf,IAAI,cAAc,EAAE,oBAAoB,KAAK,CAAC,EAC9C,IAAI,WAAW,EACf,IAAI,eAAe,EACnB,QAAQ,QAAQ;AAEnB,WAAO,OAAO,IAAI;AAAA,EACpB;AAEA,KAAG,oCAAoC,YAAY;AACjD,UAAM,QAAQ;AACd,UAAM,SAAS,MAAM,QAAQ,KAAK;AAElC,WAAO,MAAM,EAAE,UAAU,kDAAkD;AAC3E,WAAO,MAAM,EAAE,UAAU,sCAAsC;AAC/D,WAAO,MAAM,EAAE,UAAU,yBAAyB;AAAA,EACpD,CAAC;AAED,KAAG,uCAAuC,YAAY;AACpD,UAAM,QAAQ;AACd,UAAM,SAAS,MAAM,QAAQ,KAAK;AAElC,WAAO,MAAM,EAAE,UAAU,qDAAqD;AAC9E,WAAO,MAAM,EAAE,UAAU,4BAA4B;AAAA,EACvD,CAAC;AAED,KAAG,uCAAuC,YAAY;AACpD,UAAM,QAAQ;AACd,UAAM,SAAS,MAAM,QAAQ,KAAK;AAElC,WAAO,MAAM,EAAE,UAAU,qDAAqD;AAC9E,WAAO,MAAM,EAAE,UAAU,4BAA4B;AAAA,EACvD,CAAC;AAED,KAAG,yCAAyC,YAAY;AACtD,UAAM,QAAQ;AACd,UAAM,SAAS,MAAM,QAAQ,KAAK;AAElC,WA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
"names": []
|
|
7
|
+
}
|
|
@@ -1,101 +1,90 @@
|
|
|
1
|
-
import { toText } from
|
|
2
|
-
import { createLowlight } from
|
|
3
|
-
import { visit } from
|
|
4
|
-
import { lowlightLanguageMappings } from
|
|
5
|
-
|
|
1
|
+
import { toText } from "hast-util-to-text";
|
|
2
|
+
import { createLowlight } from "lowlight";
|
|
3
|
+
import { visit } from "unist-util-visit";
|
|
4
|
+
import { lowlightLanguageMappings } from "../constants.js";
|
|
6
5
|
const emptyOptions = {};
|
|
7
|
-
/**
|
|
8
|
-
* Lowlight syntax highlighting plugin for rehype pipelines
|
|
9
|
-
*
|
|
10
|
-
* Derived from: @url https://github.com/rehypejs/rehype-highlight/blob/main/lib/index.js
|
|
11
|
-
*/
|
|
12
6
|
function rehypeHighlight(options) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
if (result.children.length > 0) {
|
|
71
|
-
node.children = result.children;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
};
|
|
7
|
+
const settings = options || emptyOptions;
|
|
8
|
+
const aliases = settings.aliases;
|
|
9
|
+
const detect = options?.detect ?? false;
|
|
10
|
+
const languages = settings.languages;
|
|
11
|
+
const plainText = settings.plainText;
|
|
12
|
+
const prefix = settings.prefix;
|
|
13
|
+
const subset = settings.subset;
|
|
14
|
+
let name = "hljs";
|
|
15
|
+
const lowlight = options?.lowlight ?? createLowlight(languages);
|
|
16
|
+
if (aliases) {
|
|
17
|
+
lowlight.registerAlias(aliases);
|
|
18
|
+
}
|
|
19
|
+
if (prefix) {
|
|
20
|
+
const pos = prefix.indexOf("-");
|
|
21
|
+
name = pos > -1 ? prefix.slice(0, pos) : prefix;
|
|
22
|
+
}
|
|
23
|
+
return (tree, file) => {
|
|
24
|
+
visit(tree, "element", (node, _, parent) => {
|
|
25
|
+
if (node.tagName !== "code" || !parent || parent.type !== "element" || parent.tagName !== "pre") {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const lang = language(node);
|
|
29
|
+
if (lang === "no-highlight" || !lang && !detect || lang && plainText?.includes(lang)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (!Array.isArray(node.properties.className)) {
|
|
33
|
+
node.properties.className = [];
|
|
34
|
+
}
|
|
35
|
+
if (!node.properties.className.includes(name)) {
|
|
36
|
+
node.properties.className.unshift(name);
|
|
37
|
+
}
|
|
38
|
+
let result;
|
|
39
|
+
try {
|
|
40
|
+
result = lang ? lowlight.highlight(lang, toText(parent), { prefix }) : lowlight.highlightAuto(toText(parent), { prefix, subset });
|
|
41
|
+
} catch (error) {
|
|
42
|
+
const cause = error;
|
|
43
|
+
if (lang && /Unknown language/.test(cause.message)) {
|
|
44
|
+
file.message("Cannot highlight as `" + lang + "`, it\u2019s not registered", {
|
|
45
|
+
ancestors: [parent, node],
|
|
46
|
+
cause,
|
|
47
|
+
place: node.position,
|
|
48
|
+
ruleId: "missing-language",
|
|
49
|
+
source: "rehype-highlight"
|
|
50
|
+
});
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
throw cause;
|
|
54
|
+
}
|
|
55
|
+
if (!lang && result.data?.language) {
|
|
56
|
+
node.properties.className.push("language-" + result.data.language);
|
|
57
|
+
}
|
|
58
|
+
if (result.children.length > 0) {
|
|
59
|
+
node.children = result.children;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
75
63
|
}
|
|
76
|
-
/** Get the programming language of `node` or an empty string */
|
|
77
64
|
function language(node) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
65
|
+
const list = node.properties.className;
|
|
66
|
+
if (!Array.isArray(list)) {
|
|
67
|
+
return "";
|
|
68
|
+
}
|
|
69
|
+
const name = list.reduce((result, _item) => {
|
|
70
|
+
if (result) {
|
|
71
|
+
return result;
|
|
81
72
|
}
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
return result;
|
|
97
|
-
}, '');
|
|
98
|
-
return lowlightLanguageMappings[name || ''] || name;
|
|
73
|
+
const item = String(_item);
|
|
74
|
+
if (item === "no-highlight" || item === "nohighlight") {
|
|
75
|
+
return "no-highlight";
|
|
76
|
+
}
|
|
77
|
+
if (item.slice(0, 5) === "lang-") {
|
|
78
|
+
return item.slice(5);
|
|
79
|
+
}
|
|
80
|
+
if (item.slice(0, 9) === "language-") {
|
|
81
|
+
return item.slice(9);
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}, "");
|
|
85
|
+
return lowlightLanguageMappings[name || ""] || name;
|
|
99
86
|
}
|
|
100
|
-
|
|
101
|
-
|
|
87
|
+
export {
|
|
88
|
+
rehypeHighlight
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=rehype-highlight.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/rehype-highlight/rehype-highlight.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Element, ElementContent, Root } from 'hast'\nimport { toText } from 'hast-util-to-text'\nimport { createLowlight, type LanguageFn } from 'lowlight'\nimport { visit } from 'unist-util-visit'\nimport type { VFile } from 'vfile'\n\nimport { lowlightLanguageMappings } from '../constants'\n\ntype HighlightOptions = {\n /** Optional existing lowlight instance to use */\n lowlight?: ReturnType<typeof createLowlight> | undefined\n /** Register more aliases (optional); passed to `lowlight.registerAlias` */\n aliases?: Readonly<Record<string, ReadonlyArray<string> | string>> | null | undefined\n /** Register languages (default: `common`) passed to `lowlight.register` */\n languages?: Readonly<Record<string, LanguageFn>> | null | undefined\n /** List of language names to not highlight (optional). Note: you can also add `no-highlight` classes. */\n plainText?: ReadonlyArray<string> | null | undefined\n /** Class prefix (default: `'hljs-'`) */\n prefix?: string | null | undefined\n /** Names of languages to check when detecting (default: all registered languages) */\n subset?: ReadonlyArray<string> | null | undefined\n /** Option to autodetect languages */\n detect?: boolean\n}\n\nconst emptyOptions: HighlightOptions = {}\n\n/**\n * Lowlight syntax highlighting plugin for rehype pipelines\n *\n * Derived from: @url https://github.com/rehypejs/rehype-highlight/blob/main/lib/index.js\n */\nexport function rehypeHighlight(options?: Readonly<HighlightOptions> | null | undefined) {\n const settings = options || emptyOptions\n const aliases = settings.aliases\n const detect = options?.detect ?? false\n const languages = settings.languages\n const plainText = settings.plainText\n const prefix = settings.prefix\n const subset = settings.subset\n let name = 'hljs'\n\n // Create a lowlight instance if not provided\n const lowlight = options?.lowlight ?? createLowlight(languages)\n\n if (aliases) {\n lowlight.registerAlias(aliases)\n }\n\n if (prefix) {\n const pos = prefix.indexOf('-')\n name = pos > -1 ? prefix.slice(0, pos) : prefix\n }\n\n /** Transform.*/\n return (tree: Root, file: VFile) => {\n visit(tree, 'element', (node, _, parent) => {\n if (node.tagName !== 'code' || !parent || parent.type !== 'element' || parent.tagName !== 'pre') {\n return\n }\n\n const lang = language(node)\n\n if (lang === 'no-highlight' || (!lang && !detect) || (lang && plainText?.includes(lang))) {\n return\n }\n\n if (!Array.isArray(node.properties.className)) {\n node.properties.className = []\n }\n\n if (!node.properties.className.includes(name)) {\n node.properties.className.unshift(name)\n }\n\n let result: Root | undefined\n\n try {\n result = lang\n ? lowlight.highlight(lang, toText(parent), { prefix })\n : lowlight.highlightAuto(toText(parent), { prefix, subset })\n } catch (error) {\n const cause = error as Error\n\n if (lang && /Unknown language/.test(cause.message)) {\n file.message('Cannot highlight as `' + lang + '`, it\u2019s not registered', {\n ancestors: [parent, node],\n cause,\n place: node.position,\n ruleId: 'missing-language',\n source: 'rehype-highlight',\n })\n\n /* c8 ignore next 5 -- throw arbitrary hljs errors */\n return\n }\n\n throw cause\n }\n\n if (!lang && result.data?.language) {\n node.properties.className.push('language-' + result.data.language)\n }\n\n if (result.children.length > 0) {\n node.children = result.children as Array<ElementContent>\n }\n })\n }\n}\n\n/** Get the programming language of `node` or an empty string */\nfunction language(node: Element) {\n const list = node.properties.className\n\n if (!Array.isArray(list)) {\n return ''\n }\n\n const name: string = list.reduce<string>((result, _item) => {\n if (result) {\n return result\n }\n const item = String(_item)\n\n if (item === 'no-highlight' || item === 'nohighlight') {\n return 'no-highlight'\n }\n if (item.slice(0, 5) === 'lang-') {\n return item.slice(5)\n }\n if (item.slice(0, 9) === 'language-') {\n return item.slice(9)\n }\n\n return result\n }, '')\n\n return lowlightLanguageMappings[name || ''] || name\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,cAAc;AACvB,SAAS,sBAAuC;AAChD,SAAS,aAAa;AAGtB,SAAS,gCAAgC;AAmBzC,MAAM,eAAiC,CAAC;AAOjC,SAAS,gBAAgB,SAAyD;AACvF,QAAM,WAAW,WAAW;AAC5B,QAAM,UAAU,SAAS;AACzB,QAAM,SAAS,SAAS,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,QAAQ;AAAA,YACR,QAAQ;AAAA,UACV,CAAC;AAGD;AAAA,QACF;AAEA,cAAM;AAAA,MACR;AAEA,UAAI,CAAC,QAAQ,OAAO,MAAM,UAAU;AAClC,aAAK,WAAW,UAAU,KAAK,cAAc,OAAO,KAAK,QAAQ;AAAA,MACnE;AAEA,UAAI,OAAO,SAAS,SAAS,GAAG;AAC9B,aAAK,WAAW,OAAO;AAAA,MACzB;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAGA,SAAS,SAAS,MAAe;AAC/B,QAAM,OAAO,KAAK,WAAW;AAE7B,MAAI,CAAC,MAAM,QAAQ,IAAI,GAAG;AACxB,WAAO;AAAA,EACT;AAEA,QAAM,OAAe,KAAK,OAAe,CAAC,QAAQ,UAAU;AAC1D,QAAI,QAAQ;AACV,aAAO;AAAA,IACT;AACA,UAAM,OAAO,OAAO,KAAK;AAEzB,QAAI,SAAS,kBAAkB,SAAS,eAAe;AACrD,aAAO;AAAA,IACT;AACA,QAAI,KAAK,MAAM,GAAG,CAAC,MAAM,SAAS;AAChC,aAAO,KAAK,MAAM,CAAC;AAAA,IACrB;AACA,QAAI,KAAK,MAAM,GAAG,CAAC,MAAM,aAAa;AACpC,aAAO,KAAK,MAAM,CAAC;AAAA,IACrB;AAEA,WAAO;AAAA,EACT,GAAG,EAAE;AAEL,SAAO,yBAAyB,QAAQ,EAAE,KAAK;AACjD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"lowlight",
|
|
17
17
|
"highlightjs"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.0.
|
|
19
|
+
"version": "0.0.29",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=18"
|
|
22
22
|
},
|
|
@@ -97,11 +97,11 @@
|
|
|
97
97
|
"vfile": "^6.0.1",
|
|
98
98
|
"vite": "^5.4.10",
|
|
99
99
|
"vue": "^3.5.12",
|
|
100
|
-
"@scalar/build-tooling": "0.1.
|
|
101
|
-
"@scalar/themes": "0.11.
|
|
100
|
+
"@scalar/build-tooling": "0.1.19",
|
|
101
|
+
"@scalar/themes": "0.11.1"
|
|
102
102
|
},
|
|
103
103
|
"scripts": {
|
|
104
|
-
"build": "scalar-build-
|
|
104
|
+
"build": "scalar-build-esbuild",
|
|
105
105
|
"dev": "vite",
|
|
106
106
|
"format": "scalar-format-js",
|
|
107
107
|
"lint:check": "eslint .",
|