@scalar/code-highlight 0.4.6 → 0.4.8

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.
@@ -1,6 +1,6 @@
1
- import { c as __exportAll, i as isElement, n as createLowlight, r as convertElement, t as rehypeHighlight } from "./rehype-highlight.js";
2
- import { _ as stringify, a as zwitch, b as find, c as stringifyPosition, d as getTagID, f as TokenType, g as stringify$1, h as parse$1, i as ccount, l as Parser, m as webNamespaces, n as rehypeStringify, o as htmlVoidElements, p as fromParse5, r as whitespace, s as rehypeParse, t as unified, u as TokenizerMode, v as html$2, y as svg } from "./lib.js";
3
- import { i as convert, n as SKIP, r as visitParents, t as visit } from "./lib2.js";
1
+ import { c as __exportAll, i as isElement, r as convertElement, t as rehypeHighlight } from "./rehype-highlight.js";
2
+ import { _ as stringify$1, a as ccount, b as svg, c as rehypeParse, d as TokenizerMode, f as getTagID, g as parse$1, h as webNamespaces, i as whitespace, l as stringifyPosition, m as fromParse5, n as unified, o as zwitch, p as TokenType, r as rehypeStringify, s as htmlVoidElements, t as getSharedLowlight, u as Parser, v as stringify, x as find, y as html$2 } from "./shared-lowlight.js";
3
+ import { i as convert, n as SKIP, r as visitParents, t as visit } from "./lib.js";
4
4
  import { t as standardLanguages } from "./languages.js";
5
5
  import { t as rehypeAlert } from "./rehype-alert.js";
6
6
  //#region ../../node_modules/.pnpm/@ungap+structured-clone@1.2.0/node_modules/@ungap/structured-clone/esm/deserialize.js
@@ -20829,19 +20829,6 @@ var transformInlineMarkdownInRawHtml = () => (tree) => {
20829
20829
  });
20830
20830
  };
20831
20831
  /**
20832
- * One lowlight instance shared by every markdown pipeline.
20833
- *
20834
- * Registering the standard grammars is the most expensive part of building a
20835
- * pipeline, and the registry is read-only once built (nothing here passes
20836
- * `aliases`, the only option that mutates a given instance), so it is created
20837
- * on first use and reused from then on.
20838
- */
20839
- var sharedLowlight;
20840
- var getLowlight = () => {
20841
- sharedLowlight ??= createLowlight(standardLanguages);
20842
- return sharedLowlight;
20843
- };
20844
- /**
20845
20832
  * Build the markdown to HTML pipeline.
20846
20833
  */
20847
20834
  var createProcessor = (tagNames, transform, transformType) => unified().use(remarkParse).use(remarkGfm).use(transformNodes, {
@@ -20864,7 +20851,7 @@ var createProcessor = (tagNames, transform, transformType) => unified().use(rema
20864
20851
  "form"
20865
20852
  ]
20866
20853
  }).use(rehypeHighlight, {
20867
- lowlight: getLowlight(),
20854
+ lowlight: getSharedLowlight(standardLanguages),
20868
20855
  detect: true,
20869
20856
  className: "custom-scroll"
20870
20857
  }).use(rehypeExternalLinks, { target: "_blank" }).use(rehypeFormat).use(rehypeStringify);