mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
7d63a3e635
This commit adds events to all subparsers (that were previously not being watched).
16 lines
529 B
JavaScript
16 lines
529 B
JavaScript
/**
|
|
* Swap back in all the special characters we've hidden.
|
|
*/
|
|
showdown.subParser('unescapeSpecialChars', function (text, options, globals) {
|
|
'use strict';
|
|
text = globals.converter._dispatch('unescapeSpecialChars.before', text, options, globals);
|
|
|
|
text = text.replace(/¨E(\d+)E/g, function (wholeMatch, m1) {
|
|
var charCodeToReplace = parseInt(m1);
|
|
return String.fromCharCode(charCodeToReplace);
|
|
});
|
|
|
|
text = globals.converter._dispatch('unescapeSpecialChars.after', text, options, globals);
|
|
return text;
|
|
});
|