@scalar/code-highlight 0.4.5 → 0.4.7
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 +20 -0
- package/dist/chunks/code.js +1 -1
- package/dist/chunks/lib.js +1 -1
- package/dist/chunks/markdown.js +91 -26
- package/dist/chunks/markdown.js.map +1 -1
- package/dist/chunks/rehype-highlight.js +1 -1
- package/dist/index.js +1 -1
- package/dist/markdown/markdown.d.ts +6 -5
- package/dist/markdown/markdown.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -3015,6 +3015,6 @@ function language(node) {
|
|
|
3015
3015
|
return lowlightLanguageMappings[name || ""] || name;
|
|
3016
3016
|
}
|
|
3017
3017
|
//#endregion
|
|
3018
|
-
export {
|
|
3018
|
+
export { lowlightLanguageMappings as a, __exportAll as c, isElement as i, __toESM as l, createLowlight as n, ok as o, convertElement as r, __commonJSMin as s, rehypeHighlight as t };
|
|
3019
3019
|
|
|
3020
3020
|
//# sourceMappingURL=rehype-highlight.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as lowlightLanguageMappings, t as rehypeHighlight } from "./chunks/rehype-highlight.js";
|
|
2
2
|
import { n as jsonYamlLanguages, r as basicLanguages, t as standardLanguages } from "./chunks/languages.js";
|
|
3
3
|
import { t as syntaxHighlight } from "./chunks/code.js";
|
|
4
4
|
import { a as textFromNode, n as htmlFromMarkdown, r as isHeading } from "./chunks/markdown.js";
|
|
@@ -4,15 +4,16 @@ export type { Node } from 'mdast';
|
|
|
4
4
|
* Type-guard to check if a node is a heading.
|
|
5
5
|
*/
|
|
6
6
|
export declare const isHeading: (node: Node) => node is Heading;
|
|
7
|
-
|
|
8
|
-
* Take a Markdown string and generate HTML from it
|
|
9
|
-
*/
|
|
10
|
-
export declare function htmlFromMarkdown(markdown: string, options?: {
|
|
7
|
+
type HtmlFromMarkdownOptions = {
|
|
11
8
|
removeTags?: string[];
|
|
12
9
|
allowTags?: string[];
|
|
13
10
|
transform?: (node: Node) => Node;
|
|
14
11
|
transformType?: string;
|
|
15
|
-
}
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Take a Markdown string and generate HTML from it
|
|
15
|
+
*/
|
|
16
|
+
export declare function htmlFromMarkdown(markdown: string, options?: HtmlFromMarkdownOptions): string;
|
|
16
17
|
/**
|
|
17
18
|
* Find all headings of a specific type in a Markdown AST.
|
|
18
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/markdown/markdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/markdown/markdown.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAsD,IAAI,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AAuB/G,YAAY,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAEjC;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,IAAI,KAAG,IAAI,IAAI,OAE9C,CAAA;AAiGD,KAAK,uBAAuB,GAAG;IAC7B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAChC,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AA6GD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,MAAM,CA+B5F;AASD;;GAEG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,MAAU,GAChB;IACD,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,EAAE,CAiBF;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,GAAG,MAAM,CAUpE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,YAgC5C"}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"lowlight",
|
|
17
17
|
"highlightjs"
|
|
18
18
|
],
|
|
19
|
-
"version": "0.4.
|
|
19
|
+
"version": "0.4.7",
|
|
20
20
|
"engines": {
|
|
21
21
|
"node": ">=22"
|
|
22
22
|
},
|
|
@@ -88,11 +88,11 @@
|
|
|
88
88
|
"unist-util-visit": "^5.1.0"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
+
"@scalar/themes": "0.18.0",
|
|
91
92
|
"@types/hast": "^3.0.4",
|
|
92
93
|
"@types/mdast": "^4.0.4",
|
|
93
94
|
"vfile": "^6.0.3",
|
|
94
|
-
"vite": "8.1.5"
|
|
95
|
-
"@scalar/themes": "0.17.3"
|
|
95
|
+
"vite": "8.1.5"
|
|
96
96
|
},
|
|
97
97
|
"scripts": {
|
|
98
98
|
"build": "vite build && tsc -p tsconfig.build.json --emitDeclarationOnly && tsc-alias -p tsconfig.build.json && shx cp -r src/css dist/css",
|