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

Function startLine

static/editor.md/lib/codemirror/mode/slim/slim.js:340–366  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

338 }
339
340 function startLine(stream, state) {
341 var ch = stream.peek();
342 if (ch == '<') {
343 return (state.tokenize = startHtmlLine(state.tokenize))(stream, state);
344 }
345 if (stream.match(/^[|']/)) {
346 return startHtmlMode(stream, state, 1);
347 }
348 if (stream.match(/^\/(!|\[\w+])?/)) {
349 return commentMode(stream, state);
350 }
351 if (stream.match(/^(-|==?[<>]?)/)) {
352 state.tokenize = lineContinuable(stream.column(), commaContinuable(stream.column(), ruby));
353 return "slimSwitch";
354 }
355 if (stream.match(/^doctype\b/)) {
356 state.tokenize = doctypeLine;
357 return "keyword";
358 }
359
360 var m = stream.match(embeddedRegexp);
361 if (m) {
362 return startSubMode(m[1], state);
363 }
364
365 return slimTag(stream, state);
366 }
367
368 function slim(stream, state) {
369 if (state.startOfLine) {

Callers 1

slimFunction · 0.85

Calls 7

startHtmlLineFunction · 0.85
startHtmlModeFunction · 0.85
commentModeFunction · 0.85
lineContinuableFunction · 0.85
commaContinuableFunction · 0.85
startSubModeFunction · 0.85
slimTagFunction · 0.85

Tested by

no test coverage detected