partially working replace logic

This commit is contained in:
vabene1111
2023-12-10 16:32:12 +01:00
parent 2b05efeff6
commit d4c544bb4b
2 changed files with 80 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
import {WidgetType} from "@codemirror/view";
class PlaceholderWidget extends WidgetType {
constructor(readonly name: string) {
super()
}
eq(other: PlaceholderWidget) {
return this.name == other.name
}
toDOM() {
const elt = document.createElement("span")
elt.style.cssText = `
border: 1px solid blue;
border-radius: 4px;
padding: 0 3px;
background: lightblue;`
console.log('reading name', this.name)
elt.textContent = this.name
return elt
}
ignoreEvent() {
return false
}
}