mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
12 lines
373 B
JavaScript
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;
|
|
});
|