I think you are running into the difference between "inline" rendering and "block" rendering.
Normally, HTML and TW content is rendered "inline", which means that even if the text is
entered with embedded newlines, it is joined together so that it automatically fills each
line before wrapping to the next. Most of the time, this is what you want.
However, certain TW syntax is really intended to always start on a fresh line. To signal that,
the TW parser looks for a blank line immediately before the content. That means at least
TWO newlines entered into the source content: one to end the previous line, and another
to leave a blank.
Headings, block quotes and bullet lists work like this. Thus, if you type any of these:
Some text here
! I want a heading
Stuff below the heading
Some text here
* I want a bullet item
Stuff below the bullet
Some text here
<<<
I want a block quote
<<<
Stuff below the block quote
They don't work as you might expect, and the "!", "*" and "<<<" syntax all appear inline, like this:
Some text here ! I want a heading Stuff below the heading
Some text here * I want a bullet item Stuff below the bullet
Some text here <<< I want a block quote <<< Stuff below the block quote
To get the results you want, you have to precede the start of each of those formats with a blank line, like this:
Some text here
! I want a heading
Stuff below the heading
Some text here
* I want a bullet item
Stuff below the bullet
Some text here
<<<
I want a block quote
<<<
Stuff below the block quote
When a tiddler is rendered by itself (i.e., not in a transclusion), it automatically
starts out in "block" mode, even though there is no newline at the start of the content.
However, when that same content is transcluded, the "block" vs "inline" handling
depends on where the transclusion occurs.
If you put a blank line before the transclusion in your macro, like this:
It should fix the problem. BUT... that is a bit obscure of a solution,
since it depends on using whitespace, which doesn't *seem* like
real content.
Fortunately, there is another way to do the transclusion.
If you use the *widget* syntax for transclusion, you can specify an
additional parameter that FORCES it to use block mode rendering:
<$transclude tiddler="TiddlerName" mode="block" />
Using this syntax, you don't need to put embedded newlines in your macro
\define colortransclude(tiddler)
@@background-color:#e0e0e0;<$transclude tiddler={{$tiddler$}} mode="block" />@@
\end
You could also reduce this further to a "one line macro",
where the content is on the same line as the "\define"
and doesn't even need the closing "\end", like this:
\define colortransclude(tiddler) @@background-color:#e0e0e0;<$transclude tiddler={{$tiddler$}} mode="block" />@@
Any of the above solutions *should* give you the results you wanted.
Let me know how it goes...
enjoy,
-e