Skip to content

Commit

Permalink
rm some langs
Browse files Browse the repository at this point in the history
  • Loading branch information
rossrobino committed Sep 18, 2024
1 parent be9e4a1 commit cf7594b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-planets-wink.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@robino/md": patch
---

remove some langs - replace with aliases
1 change: 1 addition & 0 deletions packages/md/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ test("with frontmatter", async () => {
frontmatterSchema,
});
await fs.writeFile(path.join(import.meta.dirname, "test.html"), html);
console.log(html);
expect(frontmatter.title).toBeTypeOf("string");
expect(frontmatter.description).toBeTypeOf("string");
expect(frontmatter.keywords).toBeInstanceOf(Array);
Expand Down
23 changes: 7 additions & 16 deletions packages/md/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ import {
import langBash from "shiki/langs/bash.mjs";
import langCss from "shiki/langs/css.mjs";
import langHtml from "shiki/langs/html.mjs";
import langJs from "shiki/langs/javascript.mjs";
import langJson from "shiki/langs/json.mjs";
import langJsx from "shiki/langs/jsx.mjs";
import langMd from "shiki/langs/md.mjs";
import langSvelte from "shiki/langs/svelte.mjs";
import langTsx from "shiki/langs/tsx.mjs";
import langTs from "shiki/langs/typescript.mjs";
import { z } from "zod";

export interface MdHeading {
Expand Down Expand Up @@ -52,19 +48,14 @@ const variableTheme = createCssVariablesTheme();

const highlighter = createHighlighterCoreSync({
themes: [variableTheme],
langs: [
langJs,
langTs,
langHtml,
langCss,
langSvelte,
langJsx,
langTsx,
langMd,
langBash,
langJson,
],
langs: [langHtml, langCss, langTsx, langMd, langBash, langJson],
engine: createJavaScriptRegexEngine(),
langAlias: {
svelte: "html",
js: "tsx",
jsx: "tsx",
ts: "tsx",
},
}) as HighlighterGeneric<any, any>;

mdIt.use(
Expand Down

0 comments on commit cf7594b

Please sign in to comment.