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

Function hasInclude

static/editor.md/lib/codemirror/addon/fold/brace-fold.js:87–92  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

85
86CodeMirror.registerHelper("fold", "include", function(cm, start) {
87 function hasInclude(line) {
88 if (line < cm.firstLine() || line > cm.lastLine()) return null;
89 var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
90 if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
91 if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
92 }
93
94 var start = start.line, has = hasInclude(start);
95 if (has == null || hasInclude(start - 1) != null) return null;

Callers 1

brace-fold.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected