showdown/src/subParsers/unescapeSpecialChars.js
Estevão Soares dos Santos eae5f0e01f Major code refactoring
2015-01-15 21:21:33 +00:00

19 lines
411 B
JavaScript

/**
* Created by Estevao on 12-01-2015.
*/
/**
* Swap back in all the special characters we've hidden.
*/
showdown.subParser('unescapeSpecialChars', function (text) {
'use strict';
text = text.replace(/~E(\d+)E/g,
function (wholeMatch, m1) {
var charCodeToReplace = parseInt(m1);
return String.fromCharCode(charCodeToReplace);
}
);
return text;
});