Thank you Eric. When I got up one hour ago, I got myself the revelations 
that I had done the error of using the \whitespace trim pragma error! So I 
immediatly corrected my macro, before anything else (including going here 
to check any answer).

I got a way to produce the raw ouput I wanted. But it is not correctly 
rendered, even though by copying the output between pre and /pre I have the 
table output I want (that's shown at the bottom of the picture). Yes, I had 
to make some clever but ugly layout of the markup to achieve that goal of 
getting the raw text I needed.

But the table was still not well rendered. Yet, as I copied the output 
within "pre" and "/pre" tags I used to check my code, I got my table right!

And then I got the illumination :o)

In my copied-text table, I had no links! Whereas I got them between the 
"pre" and "/pre" tags! That was just because, in fact, I was not looking at 
the wikintext code I would have coded manually. Which means that I would 
need to reproduce that code as a result of my macro. Which would clutter 
the macro code. Way worse than using html for table as I've been told twice!

SO I will obey your wise counsel and go for direct html table coding.

However, here is the example code for getting a wiki text of a table (a 
simple wiki text with no links or other fancy stuff, including in what tou 
transclude (which was not hte case for the "criterion" filed in my case).

\define listCriterions()
|les <$count filter="[all[current]tagging[]butfirst[]]"/> critères liés aux 
{{!!title}}|c
| Code | Tests|Énoncé|h
<$list filter="[all[current]tagging[]butfirst[]]" 
variable="crit">|<$transclude
tiddler=<<crit>> field="code"/>|<$count
filter="[tag<crit>]butfirst[]" />|<$transclude
tiddler=<<crit>> field="criterion"/>|
</$list>
\end

The trick is to open the next widget after a pipe "|" at the end of a line, 
but to terminate that widget on the new line to avoid getting one very long 
line!

Thank you all for your help! I've learnt a lot once again.
Le samedi 10 octobre 2020 à 03:43:46 UTC+2, Eric Shulman a écrit :

> On Friday, October 9, 2020 at 3:51:35 PM UTC-7, Jean-Pierre Rivière wrote:
>>
>> I have confirmation of a problem with end of line with macro rendering 
>> text, not with wiki parsing after the macro has done its job.
>> simply surrond the macro call by pre and /pre tags. And behold below!
>>
>
> Table syntax requires newlines to terminate each row.  However, your macro 
> specifies "\whitespace trim",
> which eliminates the newlines.   Thus, your generated table output becomes 
> one long run-on line of text
> and the "|" dividers are treated as literals.
>
> Wikitext table syntax can be very sensitive to subtle issues with 
> whitespace (e.g., a single
> space character following the last "|" on a row will break the table 
> output.  Also, as you've discovered,
> you can't use <$list>...</$list> to generate rows with wikitext table 
> syntax, since the presence of the
> widgets also breaks the table output.
>
> In general, when programmatically constructing complex table output, I 
> suggest using HTML table
> syntax (i.e., table, caption, th, tr, td) instead of wikitext table 
> syntax, as it will permit much greater
> flexibility and produce more controllable results.
>
> -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/d85aed7a-4969-477f-8426-279977ccda54n%40googlegroups.com.

Reply via email to