mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-26 03:27:18 +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.explicitJoinTemplate = null;
|
||||||
this.hasTemplateInBody = false;
|
this.hasTemplateInBody = false;
|
||||||
var searchChildren = function(childNodes) {
|
var searchChildren = function(childNodes) {
|
||||||
|
var foundInlineTemplate = false;
|
||||||
$tw.utils.each(childNodes,function(node) {
|
$tw.utils.each(childNodes,function(node) {
|
||||||
if(node.type === "list-template") {
|
if(node.type === "list-template") {
|
||||||
self.explicitListTemplate = node.children;
|
self.explicitListTemplate = node.children;
|
||||||
@ -118,12 +119,14 @@ ListWidget.prototype.findExplicitTemplates = function() {
|
|||||||
self.explicitJoinTemplate = node.children;
|
self.explicitJoinTemplate = node.children;
|
||||||
} else if(node.type === "element" && node.tag === "p") {
|
} else if(node.type === "element" && node.tag === "p") {
|
||||||
searchChildren(node.children);
|
searchChildren(node.children);
|
||||||
|
foundInlineTemplate = true;
|
||||||
} else {
|
} else {
|
||||||
self.hasTemplateInBody = true;
|
foundInlineTemplate = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return foundInlineTemplate;
|
||||||
};
|
};
|
||||||
searchChildren(this.parseTreeNode.children);
|
this.hasTemplateInBody = searchChildren(this.parseTreeNode.children);
|
||||||
}
|
}
|
||||||
|
|
||||||
ListWidget.prototype.getTiddlerList = function() {
|
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