Alex Kocharin
10 years ago
13 changed files with 156 additions and 154 deletions
@ -1,18 +1,20 @@ |
|||
// Process < > " (& was processed in markdown escape)
|
|||
|
|||
module.exports = function escape_html_char(state) { |
|||
var ch = state.src.charCodeAt(state.pos); |
|||
module.exports = function escape_html_char(state, silent) { |
|||
var ch = state.src.charCodeAt(state.pos), |
|||
str; |
|||
|
|||
if (ch === 0x3C/* < */) { |
|||
state.pending += '<'; |
|||
str = '<'; |
|||
} else if (ch === 0x3E/* > */) { |
|||
state.pending += '>'; |
|||
str = '>'; |
|||
} else if (ch === 0x22/* " */) { |
|||
state.pending += '"'; |
|||
str = '"'; |
|||
} else { |
|||
return false; |
|||
} |
|||
|
|||
if (!silent) { state.pending += str; } |
|||
state.pos++; |
|||
return true; |
|||
}; |
|||
|
Loading…
Reference in new issue