On Monday, May 31, 2021 at 9:13:19 AM UTC-7 [email protected] wrote: > I've finally tracked it down to the macro having each of the <$set ...> > tags and their respective closing tags on separate lines (simple example > below). If I put everything on a single line, the rogue spaces disappear! > This is odd behaviour to me, as I've always been taught (and found) that > multi-line HTML/XML is easier to read, and therefore easier to maintain. Is > this expected behaviour or a bug? >
Even in HTML, whitespace matters. If you enter text like this: Some words on the first line followed by some words on a second line The line break is NOT ignored. Rather, it is treated as a single whitespace character and is reduced to a single space. Thus, the HTML content is rendered as: Some words on the first line followed by some words on a second line In TiddlyWiki, you can eliminate this unwanted whitespace by using the "\whitespace trim" syntax. If you place this syntax at the start of the tiddler, it will affect all content in that tiddler If you place this syntax as the first line of a macro definition, it will only affect the content of that macro Thus, for your purposes, you could write: \define multi-line-example() \whitespace trim xx<$set name="var1" value="A"> yy<$set name="var2" value="B"> zz<<var1>><<var2>>zz </$set>yy </$set>xx \end enjoy, -e -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/7f1bbfac-4fe9-46e0-8a9e-6e91f5c57960n%40googlegroups.com.

