diff --git a/package-lock.json b/package-lock.json index fef3349ec..4552087b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,7 +66,6 @@ "katex": "0.16.21", "leaflet": "1.9.4", "leaflet-gpx": "2.1.2", - "mark.js": "8.11.1", "marked": "15.0.7", "mermaid": "11.6.0", "mime-types": "2.1.35", @@ -173,6 +172,7 @@ "jsdoc": "4.0.4", "knockout": "3.5.1", "lorem-ipsum": "2.0.8", + "mark.js": "8.11.1", "mind-elixir": "4.4.3", "mini-css-extract-plugin": "2.9.2", "nodemon": "3.1.9", @@ -15066,6 +15066,7 @@ "version": "8.11.1", "resolved": "https://registry.npmjs.org/mark.js/-/mark.js-8.11.1.tgz", "integrity": "sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==", + "dev": true, "license": "MIT" }, "node_modules/markdown-it": { diff --git a/package.json b/package.json index bb0c7c357..b16a233a0 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,6 @@ "katex": "0.16.21", "leaflet": "1.9.4", "leaflet-gpx": "2.1.2", - "mark.js": "8.11.1", "marked": "15.0.7", "mermaid": "11.6.0", "mime-types": "2.1.35", @@ -229,6 +228,7 @@ "jsdoc": "4.0.4", "knockout": "3.5.1", "lorem-ipsum": "2.0.8", + "mark.js": "8.11.1", "mind-elixir": "4.4.3", "mini-css-extract-plugin": "2.9.2", "nodemon": "3.1.9", diff --git a/src/public/app/services/library_loader.ts b/src/public/app/services/library_loader.ts index babd4a14d..3f8d95c88 100644 --- a/src/public/app/services/library_loader.ts +++ b/src/public/app/services/library_loader.ts @@ -51,10 +51,6 @@ const KATEX: Library = { css: ["node_modules/katex/dist/katex.min.css"] }; -const MARKJS: Library = { - js: ["node_modules/mark.js/dist/jquery.mark.es6.min.js"] -}; - const HIGHLIGHT_JS: Library = { js: () => { const mimeTypes = mimeTypesService.getMimeTypes(); @@ -172,7 +168,6 @@ export default { CODE_MIRROR, CALENDAR_WIDGET, KATEX, - MARKJS, HIGHLIGHT_JS, LEAFLET }; diff --git a/src/public/app/widgets/find_in_html.ts b/src/public/app/widgets/find_in_html.ts index d1e9a93db..f64d403ff 100644 --- a/src/public/app/widgets/find_in_html.ts +++ b/src/public/app/widgets/find_in_html.ts @@ -1,11 +1,11 @@ // ck-find-result and ck-find-result_selected are the styles ck-editor // uses for highlighting matches, use the same one on CodeMirror // for consistency -import libraryLoader from "../services/library_loader.js"; import utils from "../services/utils.js"; import appContext from "../components/app_context.js"; import type FindWidget from "./find.js"; import type { FindResult } from "./find.js"; +import 'mark.js'; const FIND_RESULT_SELECTED_CSS_CLASSNAME = "ck-find-result_selected"; const FIND_RESULT_CSS_CLASSNAME = "ck-find-result"; @@ -23,8 +23,6 @@ export default class FindInHtml { } async performFind(searchTerm: string, matchCase: boolean, wholeWord: boolean) { - await libraryLoader.requireLibrary(libraryLoader.MARKJS); - const $content = await this.parent?.noteContext?.getContentElement(); const wholeWordChar = wholeWord ? "\\b" : ""; diff --git a/src/public/app/widgets/view_widgets/list_or_grid_view.ts b/src/public/app/widgets/view_widgets/list_or_grid_view.ts index 56ee00b86..8760dc4ca 100644 --- a/src/public/app/widgets/view_widgets/list_or_grid_view.ts +++ b/src/public/app/widgets/view_widgets/list_or_grid_view.ts @@ -2,11 +2,11 @@ import linkService from "../../services/link.js"; import contentRenderer from "../../services/content_renderer.js"; import froca from "../../services/froca.js"; import attributeRenderer from "../../services/attribute_renderer.js"; -import libraryLoader from "../../services/library_loader.js"; import treeService from "../../services/tree.js"; import utils from "../../services/utils.js"; import type FNote from "../../entities/fnote.js"; import ViewMode, { type ViewModeArgs } from "./view_mode.js"; +import 'mark.js'; const TPL = `