MCPcopy
hub / github.com/evilstreak/markdown-js / _split_on_unescaped

Function _split_on_unescaped

lib/markdown.js:1331–1343  ·  view source on GitHub ↗
(s, ch)

Source from the content-addressed store, hash-verified

1329Markdown.dialects.Maruku.block.table = function table (block, next) {
1330
1331 var _split_on_unescaped = function(s, ch) {
1332 ch = ch || '\\s';
1333 if (ch.match(/^[\\|\[\]{}?*.+^$]$/)) { ch = '\\' + ch; }
1334 var res = [ ],
1335 r = new RegExp('^((?:\\\\.|[^\\\\' + ch + '])*)' + ch + '(.*)'),
1336 m;
1337 while(m = s.match(r)) {
1338 res.push(m[1]);
1339 s = m[2];
1340 }
1341 res.push(s);
1342 return res;
1343 }
1344
1345 var leading_pipe = /^ {0,3}\|(.+)\n {0,3}\|\s*([\-:]+[\-| :]*)\n((?:\s*\|.*(?:\n|$))*)(?=\n|$)/,
1346 // find at least an unescaped pipe in each line

Callers 1

markdown.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected