|
|
@ -2,12 +2,15 @@ |
|
|
|
// and increment current pos
|
|
|
|
|
|
|
|
module.exports = function text(state, silent) { |
|
|
|
var match = state.src.slice(state.pos).match(state.parser.textMatch); |
|
|
|
var str = state.src.slice(state.pos), |
|
|
|
next = str.search(state.parser.textMatch); |
|
|
|
|
|
|
|
if (!match) { return false; } |
|
|
|
if (next === 0) { return false; } |
|
|
|
|
|
|
|
if (!silent) { state.pending += match[0]; } |
|
|
|
state.pos += match[0].length; |
|
|
|
if (next < 0) { next = str.length; } |
|
|
|
|
|
|
|
if (!silent) { state.pending += str.slice(0, next); } |
|
|
|
state.pos += next; |
|
|
|
|
|
|
|
return true; |
|
|
|
}; |
|
|
|