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

Function readQuoted

static/editor.md/lib/codemirror/mode/slim/slim.js:456–489  ·  view source on GitHub ↗
(quote, style, embed, unescaped, nextTokenize)

Source from the content-addressed store, hash-verified

454 return slimAttribute(stream, state);
455 }
456 function readQuoted(quote, style, embed, unescaped, nextTokenize) {
457 return function(stream, state) {
458 finishContinue(state);
459 var fresh = stream.current().length == 0;
460 if (stream.match(/^\\$/, fresh)) {
461 if (!fresh) return style;
462 continueLine(state, state.indented);
463 return "lineContinuation";
464 }
465 if (stream.match(/^#\{/, fresh)) {
466 if (!fresh) return style;
467 state.tokenize = rubyInQuote("}", state.tokenize);
468 return null;
469 }
470 var escaped = false, ch;
471 while ((ch = stream.next()) != null) {
472 if (ch == quote && (unescaped || !escaped)) {
473 state.tokenize = nextTokenize;
474 break;
475 }
476 if (embed && ch == "#" && !escaped) {
477 if (stream.eat("{")) {
478 stream.backUp(2);
479 break;
480 }
481 }
482 escaped = !escaped && ch == "\\";
483 }
484 if (stream.eol() && escaped) {
485 stream.backUp(1);
486 }
487 return style;
488 };
489 }
490 function slimContent(stream, state) {
491 if (stream.match(/^==?/)) {
492 state.tokenize = ruby;

Callers 2

attributeWrapperValueFunction · 0.70
slimAttributeValueFunction · 0.70

Calls 3

finishContinueFunction · 0.85
continueLineFunction · 0.85
rubyInQuoteFunction · 0.70

Tested by

no test coverage detected