showdown/src/subParsers/unescapeSpecialChars.js

13 lines
324 B
JavaScript
Raw Normal View History

2015-01-16 05:21:33 +08:00
/**
* Swap back in all the special characters we've hidden.
*/
showdown.subParser('unescapeSpecialChars', function (text) {
2015-01-19 19:37:21 +08:00
'use strict';
2015-01-16 05:21:33 +08:00
2015-01-19 19:37:21 +08:00
text = text.replace(/~E(\d+)E/g, function (wholeMatch, m1) {
var charCodeToReplace = parseInt(m1);
return String.fromCharCode(charCodeToReplace);
});
return text;
2015-01-16 05:21:33 +08:00
});