Skip to content

Commit b1bc17d

Browse files
committed
some cleanups
1 parent dda0310 commit b1bc17d

File tree

3 files changed

+11
-22
lines changed

3 files changed

+11
-22
lines changed

src/components/referencesPanel/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { EditorView } from "@codemirror/view";
22
import Sidebar from "components/sidebar";
3+
import DOMPurify from "dompurify";
34
import openFile from "lib/openFile";
45
import {
56
clearHighlightCache,
@@ -101,7 +102,7 @@ export function createReferenceItem(item, options = {}) {
101102
</div>
102103
);
103104

104-
$el.get(".ref-preview").innerHTML = item.highlightedText;
105+
$el.get(".ref-preview").innerHTML = DOMPurify.sanitize(item.highlightedText);
105106

106107
return $el;
107108
}

src/handlers/quickToolsInit.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,6 @@ export default function init() {
8181
$footer.removeAttribute("data-unsaved");
8282
});
8383

84-
// TODO Codemirro
85-
// editorManager.editor.on("focus", () => {
86-
// if (key.shift || key.ctrl || key.alt || key.meta) {
87-
// quickTools.$input.focus();
88-
// }
89-
// });
90-
9184
root.append($footer, $toggler);
9285
document.body.append($input);
9386
if (

src/lib/editorManager.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11
import sidebarApps from "sidebarApps";
2-
3-
import {
4-
setKeyBindings as applyKeyBindings,
5-
executeCommand,
6-
getCommandKeymapExtension,
7-
getRegisteredCommands,
8-
refreshCommandKeymap,
9-
registerExternalCommand,
10-
removeExternalCommand,
11-
} from "cm/commandRegistry";
12-
// TODO: Migrate touch handlers to CodeMirror
13-
// import touchListeners, { scrollAnimationFrame } from "ace/touchHandler";
14-
152
import { indentUnit } from "@codemirror/language";
163
import { search } from "@codemirror/search";
174
import { Compartment, EditorState, Prec, StateEffect } from "@codemirror/state";
@@ -34,6 +21,15 @@ import {
3421
wrapWithAbbreviation,
3522
} from "@emmetio/codemirror6-plugin";
3623
import createBaseExtensions from "cm/baseExtensions";
24+
import {
25+
setKeyBindings as applyKeyBindings,
26+
executeCommand,
27+
getCommandKeymapExtension,
28+
getRegisteredCommands,
29+
refreshCommandKeymap,
30+
registerExternalCommand,
31+
removeExternalCommand,
32+
} from "cm/commandRegistry";
3733
import lspClientManager from "cm/lsp/clientManager";
3834
import {
3935
getLspDiagnostics,
@@ -68,7 +64,6 @@ import quickTools from "components/quickTools";
6864
import ScrollBar from "components/scrollbar";
6965
import SideButton, { sideButtonContainer } from "components/sideButton";
7066
import keyboardHandler, { keydownState } from "handlers/keyboard";
71-
// TODO: Update EditorFile for CodeMirror compatibility
7267
import EditorFile from "./editorFile";
7368
import openFile from "./openFile";
7469
import { addedFolder } from "./openFolder";

0 commit comments

Comments
 (0)