mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2025-08-22 05:24:05 +07:00
21 lines
460 B
JavaScript
21 lines
460 B
JavaScript
/**
|
|
* Run extension
|
|
*/
|
|
showdown.subParser('runExtension', function (ext, text, options, globals) {
|
|
'use strict';
|
|
|
|
if (ext.filter) {
|
|
text = ext.filter(text, globals.converter, options);
|
|
|
|
} else if (ext.regex) {
|
|
// TODO remove this when old extension loading mechanism is deprecated
|
|
var re = ext.regex;
|
|
if (!(re instanceof RegExp)) {
|
|
re = new RegExp(re, 'g');
|
|
}
|
|
text = text.replace(re, ext.replace);
|
|
}
|
|
|
|
return text;
|
|
});
|