MCPcopy Create free account
hub / github.com/TruthHun/BookStack / toTagEnd

Function toTagEnd

static/editor.md/lib/codemirror/addon/fold/xml-fold.js:46–56  ·  view source on GitHub ↗
(iter)

Source from the content-addressed store, hash-verified

44 }
45
46 function toTagEnd(iter) {
47 for (;;) {
48 var gt = iter.text.indexOf(">", iter.ch);
49 if (gt == -1) { if (nextLine(iter)) continue; else return; }
50 if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; }
51 var lastSlash = iter.text.lastIndexOf("/", gt);
52 var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
53 iter.ch = gt + 1;
54 return selfClose ? "selfClose" : "regular";
55 }
56 }
57 function toTagStart(iter) {
58 for (;;) {
59 var lt = iter.ch ? iter.text.lastIndexOf("<", iter.ch - 1) : -1;

Callers 2

findMatchingCloseFunction · 0.85
xml-fold.jsFile · 0.85

Calls 2

nextLineFunction · 0.85
tagAtFunction · 0.85

Tested by

no test coverage detected