mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-25 19:17:19 +00:00
Fix for list widget with an empty paragraph as inline template (#7903)
Fixes #7902
This commit is contained in:
parent
d2d00ffa4d
commit
e2d4388c48
@ -109,6 +109,7 @@ ListWidget.prototype.findExplicitTemplates = function() {
|
||||
this.explicitJoinTemplate = null;
|
||||
this.hasTemplateInBody = false;
|
||||
var searchChildren = function(childNodes) {
|
||||
var foundInlineTemplate = false;
|
||||
$tw.utils.each(childNodes,function(node) {
|
||||
if(node.type === "list-template") {
|
||||
self.explicitListTemplate = node.children;
|
||||
@ -118,12 +119,14 @@ ListWidget.prototype.findExplicitTemplates = function() {
|
||||
self.explicitJoinTemplate = node.children;
|
||||
} else if(node.type === "element" && node.tag === "p") {
|
||||
searchChildren(node.children);
|
||||
foundInlineTemplate = true;
|
||||
} else {
|
||||
self.hasTemplateInBody = true;
|
||||
foundInlineTemplate = true;
|
||||
}
|
||||
});
|
||||
return foundInlineTemplate;
|
||||
};
|
||||
searchChildren(this.parseTreeNode.children);
|
||||
this.hasTemplateInBody = searchChildren(this.parseTreeNode.children);
|
||||
}
|
||||
|
||||
ListWidget.prototype.getTiddlerList = function() {
|
||||
|
@ -0,0 +1,13 @@
|
||||
title: ListWidget/WithEmptyParagraphTemplate
|
||||
description: List widget with an empty paragraph as inline template
|
||||
type: text/vnd.tiddlywiki-multiple
|
||||
tags: [[$:/tags/wiki-test-spec]]
|
||||
|
||||
+
|
||||
title: Output
|
||||
|
||||
<$list filter="1"><p/></$list>
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p><p></p></p>
|
Loading…
Reference in New Issue
Block a user