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

Function toPrevTag

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

Source from the content-addressed store, hash-verified

77 }
78 }
79 function toPrevTag(iter) {
80 for (;;) {
81 var gt = iter.ch ? iter.text.lastIndexOf(">", iter.ch - 1) : -1;
82 if (gt == -1) { if (prevLine(iter)) continue; else return; }
83 if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; }
84 var lastSlash = iter.text.lastIndexOf("/", gt);
85 var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
86 iter.ch = gt + 1;
87 return selfClose ? "selfClose" : "regular";
88 }
89 }
90
91 function findMatchingClose(iter, tag) {
92 var stack = [];

Callers 1

findMatchingOpenFunction · 0.85

Calls 2

prevLineFunction · 0.85
tagAtFunction · 0.85

Tested by

no test coverage detected