Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Transcluding with $output=text/raw fails for tiddlers #8925

Open
jeremyredhead opened this issue Jan 31, 2025 · 0 comments
Open

[BUG] Transcluding with $output=text/raw fails for tiddlers #8925

jeremyredhead opened this issue Jan 31, 2025 · 0 comments

Comments

@jeremyredhead
Copy link
Contributor

Describe the bug

Actually, I am not 100% sure if this is a bug as I can barely find any discussion about this at all (in fact, the current documentation for $output=text/raw is so deficient as to be almost nonexistent. I'll try and remember to open a docs PR to rectify that as well later)...

But in v5.3.0 you could transclude the raw text of a tiddler with <$transclude $tiddler="TIDDLER" $output="text/raw"/>, whilst in v5.3.1+ you get nada. It's unsurprising that this was overlooked, as text/raw is much more important for variables & esp. macros b/c of substitution, whilst you can achieve similar for tiddlers with <$transclude $tiddler="TIDDLER" $type="text/plain"/>, but I'd argue it's still important to support text/raw for tiddlers as well, mainly for consistency, but also because of the subtle difference that $output="text/raw" generates just the text node whilst $type="text/plain" generates the text node wrapped in <pre><code>

Based on some cursory browsing of the git history, it looks like the bug/change was introduced in #7647 most likely, though I'm not 100% sure (haven't actually tested the code in question or even read it thoroughly enough to grok it)

Expected behavior

The $transclude widget should be able to transclude the raw text of tiddlers by setting $output="text/raw"

To Reproduce

Paste the below into a new tiddler on https://tiddlywiki.com and save/preview. Observe that the text of the transcluded tiddler(s) is not, err, transcluded.

<pre><$transclude $tiddler="$:/core" $subtiddler="$:/core/templates/static.content" $output="text/raw" /></pre>

<pre><$transclude $tiddler="$:/core/templates/static.content" $output="text/raw" /></pre>

<pre><$transclude $tiddler="$:/ControlPanel" $field="icon" $output="text/raw" /></pre>

Screenshots

No response

TiddlyWiki Configuration

  • Version: v5.3.1 - v5.3.6

Additional context

P.S. I noticed this while drafting/testing #8924 and it bothered me enough to look into it more deeply.

P.P.S. Notes to self wrt text/raw (&/or other people if I don't get around to submitting that docs PR): transclude widget docs should clearly describe the differences between $type vs $output and text/plain vs text/raw and tiddlers vs variables and how those all intersect. macrocall docs should also briefly note the meaning of text/raw (restoring text that used to be there) but only as it regards to variables. or maybe it should just state that more details can be found at the transclude docs

P.P.P.S. sorry this bug report is such a hot mess :p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant