We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 801225d commit e95cfd2Copy full SHA for e95cfd2
src/editor/extension.tsx
@@ -372,14 +372,10 @@ export function highlightExtension(
372
}
373
374
// Helper function to create a new highlight
375
-export function createHighlight(view: EditorView) {
+export function createHighlight(view: EditorView, selectedText: string) {
376
const selection = view.state.selection.main;
377
if (selection.empty) return false;
378
379
- const selectedText = view.state.doc.sliceString(
380
- selection.from,
381
- selection.to
382
- );
383
const highlightText = `==${selectedText}==`;
384
385
const transaction = view.state.update({
0 commit comments