diff --git a/core/modules/parsers/wikiparser/wikiparser.js b/core/modules/parsers/wikiparser/wikiparser.js index f27d682bf..ff6c1df54 100644 --- a/core/modules/parsers/wikiparser/wikiparser.js +++ b/core/modules/parsers/wikiparser/wikiparser.js @@ -235,7 +235,8 @@ WikiParser.prototype.parseBlock = function(terminatorRegExpString) { var children = this.parseInlineRun(terminatorRegExp); var end = this.pos; if (children[0].type === "text" || - ($tw.config.htmlBlockElements.indexOf(children[0].tag) === -1 && children[0]?.tag?.charAt(0) !== "$")) { + (($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;