1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-09-06 21:08:01 +00:00

Addresses #7836: Noisy $fill widgets (#8930)

$fill widgets will get ignored when encountered by ts-raw slots
This commit is contained in:
Cameron Fischer
2025-02-14 12:57:06 -05:00
committed by GitHub
parent 3051e8dddc
commit 4425a891bc
2 changed files with 38 additions and 0 deletions

View File

@@ -24,6 +24,10 @@ Inherit from the base widget class
*/
FillWidget.prototype = new Widget();
FillWidget.prototype.execute = function() {
// Do nothing. Make no child widgets. $Fill widgets should be invisible when naturally encountered. Instead, their parseTreeNodes are made available to $slot widgets that want it.
};
exports.fill = FillWidget;
})();

View File

@@ -0,0 +1,34 @@
title: Transclude/CustomWidget/RawAndSlotted
description: Custom widget can mix ts-raw and custom slots
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\whitespace trim
\widget $my.widget()
\whitespace trim
<$slot $name="ts-header">
Default Header
</$slot>
-
<$slot $name="ts-raw"/>
\end
<$my.widget>
First Body
</$my.widget>
<$my.widget>
<$fill $name="ts-header">
Custom Header
</$fill>
<$fill $name="ts-never">
<$log RawAndSlotted="Transclude/CustomWidget/RawAndSlotted is actually failing. $fill slots are executing silently when they weren't invoked." />
</$fill>
Second Body
</$my.widget>
+
title: ExpectedResult
<p>Default Header-First Body</p><p>Custom Header-Second Body</p>