Skip to content

Commit

Permalink
Remove higlight.js and marked highlighting.
Browse files Browse the repository at this point in the history
Since there isn't too much of the code nowadays that should be actually
highlighted, just remove it.
  • Loading branch information
SpacingBat3 committed Dec 25, 2024
1 parent e456baf commit eeb070a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 31 deletions.
20 changes: 0 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@
"@spacingbat3/kolor": "^4.0.0",
"deepmerge-ts": "^7.0.3",
"dompurify": "^3.0.1",
"highlight.js": "^11.4.0",
"marked": "^15.0.4",
"marked-gfm-heading-id": "^4.0.0",
"marked-highlight": "^2.0.1",
"semver": "^7.3.5",
"source-map-support": "^0.5.21",
"tslib": "^2.3.1",
Expand Down
9 changes: 1 addition & 8 deletions sources/code/renderer/preload/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { existsSync, readFileSync } from "node:fs";
import { pathToFileURL, fileURLToPath } from "node:url";

import { marked } from "marked";
import { markedHighlight } from "marked-highlight";
import { sanitize } from "dompurify";
import hljs from "highlight.js";

import { protocols } from "../../common/global";

Expand All @@ -19,15 +17,10 @@ import {

const htmlFileUrl = document.URL;

// Code highlighting and GFM heading IDs:
// GFM heading IDs:

marked.use(
//@ts-expect-error due to TS2379
markedHighlight({
highlight: (code,language) => hljs.getLanguage(language) ?
hljs.highlight(code,{ language } ).value :
code
}),
gfmHeadingId()
);

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/* Whenever comments are emitted to files */
"removeComments": true,
/* Replace a set of core libraries. */
"lib": ["ES2022", "DOM.Iterable"],
"lib": ["ES2022", "DOM", "DOM.Iterable"],
/* Limit module resolution to project's path only */
"typeRoots": ["./node_modules/@types"],
/* Use `tslib` for import helpers. */
Expand Down

0 comments on commit eeb070a

Please sign in to comment.