chore(ckeditor5): fix type errors

This commit is contained in:
Elian Doran 2025-05-27 23:36:41 +03:00
parent fe8e090b1b
commit 7972d3f31b
No known key found for this signature in database

View File

@ -1,7 +1,12 @@
import type { Element, Writer } from "ckeditor5"; import type { Element, Position, Writer } from "ckeditor5";
import type { Node, Editor } from "ckeditor5"; import type { Node, Editor } from "ckeditor5";
import { Plugin } from "ckeditor5"; import { Plugin } from "ckeditor5";
interface SpanStackEntry {
className: string;
posStart: Position;
}
/* /*
* This code is an adaptation of https://github.com/antoniotejada/Trilium-SyntaxHighlightWidget with additional improvements, such as: * This code is an adaptation of https://github.com/antoniotejada/Trilium-SyntaxHighlightWidget with additional improvements, such as:
* *
@ -234,10 +239,10 @@ export default class SyntaxHighlighting extends Plugin {
let iHtml = 0; let iHtml = 0;
let html = highlightRes.value; let html = highlightRes.value;
let spanStack = []; let spanStack: SpanStackEntry[] = [];
let iChild = -1; let iChild = -1;
let childText = ""; let childText = "";
let child = null; let child: Node | null = null;
let iChildText = 0; let iChildText = 0;
while (iHtml < html.length) { while (iHtml < html.length) {