showdown/src/subParsers/strikethrough.js
2015-08-03 03:47:49 +01:00

12 lines
373 B
JavaScript

showdown.subParser('strikethrough', function (text, options, globals) {
'use strict';
if (options.strikethrough) {
text = globals.converter._dispatch('strikethrough.before', text, options);
text = text.replace(/(?:~T){2}([^~]+)(?:~T){2}/g, '<del>$1</del>');
text = globals.converter._dispatch('strikethrough.after', text, options);
}
return text;
});