mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
12 lines
394 B
JavaScript
12 lines
394 B
JavaScript
showdown.subParser('strikethrough', function (text, options, globals) {
|
|
'use strict';
|
|
|
|
if (options.strikethrough) {
|
|
text = globals.converter._dispatch('strikethrough.before', text, options, globals);
|
|
text = text.replace(/(?:~T){2}([\s\S]+?)(?:~T){2}/g, '<del>$1</del>');
|
|
text = globals.converter._dispatch('strikethrough.after', text, options, globals);
|
|
}
|
|
|
|
return text;
|
|
});
|