Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed https://markdown-it.github.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

20 lines
433 B

// Process < > " (& was processed in markdown escape)
module.exports = function escape_html_char(state, silent) {
var ch = state.src.charCodeAt(state.pos),
str;
if (ch === 0x3C/* < */) {
str = '&lt;';
} else if (ch === 0x3E/* > */) {
str = '&gt;';
} else if (ch === 0x22/* " */) {
str = '&quot;';
} else {
return false;
}
if (!silent) { state.pending += str; }
state.pos++;
return true;
};