1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-25 15:12:24 +00:00

wikiparser.js -- WIP fix redundant p tags

This commit is contained in:
pmario 2024-02-16 22:33:14 +01:00
parent 7bcda7ffb3
commit 260c72fd3d

View File

@ -241,7 +241,14 @@ WikiParser.prototype.parseBlock = function(terminatorRegExpString) {
var start = this.pos;
var children = this.parseInlineRun(terminatorRegExp);
var end = this.pos;
return [{type: "element", tag: "p", children: children, start: start, end: end }];
// return [{type: "element", tag: "p", children: children, start: start, end: end }];
if (children[0].type === "text" ||
(($tw.config.htmlBlockElements.indexOf(children[0].tag) === -1) && children[0] &&
children[0].tag && children[0].tag.charAt(0) !== "$")) {
return [{type: "element", tag: "p", children: children, start: start, end: end }];
} else {
return children;
}
};
/*