Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Dec 14, 2023
1 parent 75855a7 commit 5cd604e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/docview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ class BlockGapWidget extends WidgetType {

toDOM() {
let elt = document.createElement("div")
elt.className = "cm-gap"
this.updateDOM(elt)
return elt
}
Expand Down
3 changes: 2 additions & 1 deletion test/webtest-draw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ function domText(view: EditorView) {
let text = "", eol = false
function scan(node: Node) {
if (node.nodeType == 1) {
if (node.nodeName == "BR" || (node as HTMLElement).contentEditable == "false") return
if (node.nodeName == "BR" || (node as HTMLElement).contentEditable == "false" ||
(node as HTMLElement).className == "cm-gap") return
if (eol) { text += "\n"; eol = false }
for (let ch = node.firstChild as (Node | null); ch; ch = ch.nextSibling) scan(ch)
eol = true
Expand Down

0 comments on commit 5cd604e

Please sign in to comment.