邓淳远、崔鹏宇、翁思扬组云计算期末项目
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.
 
 
 
 

18 lines
764 B

/**
* Hash and escape <code> elements that should not be parsed as markdown
*/
showdown.subParser('makehtml.hashCodeTags', function (text, options, globals) {
'use strict';
text = globals.converter._dispatch('makehtml.hashCodeTags.before', text, options, globals).getText();
var repFunc = function (wholeMatch, match, left, right) {
var codeblock = left + showdown.subParser('makehtml.encodeCode')(match, options, globals) + right;
return '¨C' + (globals.gHtmlSpans.push(codeblock) - 1) + 'C';
};
// Hash naked <code>
text = showdown.helper.replaceRecursiveRegExp(text, repFunc, '<code\\b[^>]*>', '</code>', 'gim');
text = globals.converter._dispatch('makehtml.hashCodeTags.after', text, options, globals).getText();
return text;
});