horizontal rule

This commit is contained in:
Estevão Soares dos Santos 2022-05-07 19:11:50 +01:00
parent 9a66e63952
commit 1dcaa4490e

View File

@ -21,20 +21,34 @@ showdown.subParser('makehtml.horizontalRule', function (text, options, globals)
text = startEvent.output;
const rgx1 = /^ {0,2}( ?-){3,}[ \t]*$/gm;
text = text.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm, function (wholeMatch) {
// parses: --- and - - -
const rgx1 = /^ {0,3}( ?-){3,}[ \t]*$/gm;
text = text.replace(rgx1, function (wholeMatch) {
return parse(rgx1, wholeMatch);
});
const rgx2 = /^ {0,2}( ?\*){3,}[ \t]*$/gm;
text = text.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm, function (wholeMatch) {
// parses: -\t-\t-
const rgx2 = /^ {0,3}(\t?-){3,}[ \t]*$/gm;
text = text.replace(rgx2, function (wholeMatch) {
return parse(rgx2, wholeMatch);
});
const rgx3 = /^ {0,2}( ?\*){3,}[ \t]*$/gm;
text = text.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm, function (wholeMatch) {
const rgx3 = /^ {0,3}( ?\*){3,}[ \t]*$/gm;
text = text.replace(rgx3, function (wholeMatch) {
return parse(rgx3, wholeMatch);
});
const rgx4 = /^ {0,3}(\t?\*){3,}[ \t]*$/gm;
text = text.replace(rgx4, function (wholeMatch) {
return parse(rgx4, wholeMatch);
});
const rgx5 = /^ {0,3}( ?\*){3,}[ \t]*$/gm;
text = text.replace(rgx5, function (wholeMatch) {
return parse(rgx5, wholeMatch);
});
const rgx6 = /^ {0,3}(\t?\*){3,}[ \t]*$/gm;
text = text.replace(rgx6, function (wholeMatch) {
return parse(rgx6, wholeMatch);
});
let afterEvent = new showdown.Event('makehtml.horizontalRule.onEnd', text);
afterEvent