Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("doesn't redraw siblings of a split node", () => {
let view = tempEditor({doc: doc(p("foo"), h1("bar"), pre("baz"))})
let oldP = view.dom.querySelector("p")
let oldPre = view.dom.querySelector("pre")
view.dispatch(view.state.tr.split(8))
ist(view.dom.querySelector("p"), oldP)
ist(view.dom.querySelector("pre"), oldPre)
})
it("can change multiple blocks", () =>
type(doc(h1("<a>hello"), p("there"), p("<b>you"), p("end")),
doc(pre("hello"), pre("there"), pre("you"), p("end")),
"code_block"))
</b></a>
it("clears nodes from joined node that wouldn't be allowed in target node", () =>
apply(doc(pre("foo<a>"), p("bar", img)), joinForward, doc(pre("foo</a><a>bar"))))
</a>
it("completes a count", () =>
fill3("code_block{3} paragraph{3}",
doc(pre()), doc(p()), doc(), doc(pre(), pre()), doc(p(), p())))
it("clears markup when necessary", () =>
type(doc(p("hello<a> ", em("world"))),
doc(pre("hello world")),
"code_block"))
</a>
it("skips nodes that can't be changed due to constraints", () =>
type(doc(p("<a>hello", img), p("okay"), ul(li(p("foo<b>")))),
doc(pre("</b></a><b><a>hello"), pre("okay"), ul(li(p("foo<b>")))),
"code_block"))
})</b></a></b>
it("can make a block a code block", () =>
apply(doc(h1("fo<a>o")), setCode, doc(pre("foo"))))
</a>
it("clears marks when necessary", () =>
apply(doc(p("fo<a>o", em("bar"))), setCode, doc(pre("foobar"))))
</a>