[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-24 Thread Misterel85
Hi Tones, Thank you very much for your solution. Being away from my computer for the last few days, I could try it only this afternoon. I managed to twist it to my needs and it seems to work fine, which is great! I understand the way you implemented your solution, but I have three specific

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-18 Thread TW Tones
Stephanie It took a little time to wade through the combinations. I also found there are possibly many ways to do this. The attached json has a view template that displays the detail or references if they exist according to your specs, the view template itself is for all other setting and the

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-18 Thread Joshua Fontany
Stéphane, Some-one on GitHub in the bug report (link) mentioned that you can "view" the raw text of a field with the View Widget. So, where as {{foo!!bar}} is a shortcut for <$tiddler tiddler="foo"><$translcude tiddler=<> field="bar"/> You can create a macro that uses the View Widget like

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-18 Thread Misterel85
Thank you for your very interesting and useful examples, Tones. I didn't know about `sentencecase`! I'll keep that post as a reference. And thank you very much for proposing your help. Sorry for not replying sooner. I've spent the last two days thinking those field connexion rules over for my

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-16 Thread TW Tones
Misterel, Perhaps my writing is not so helpful, but my advice is intended to make it simpler for you. I would be happy to write the code to resolve the concatenation of various text snippets into sentence like text. All I would need is samples of the text you whish to join (without

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-16 Thread Misterel85
Joshua, Thanks for letting me know! Glad to have contributed to the bug chase through that seemingly inconspicuous question! I don't know much about GitHub, therefore I let you file that bug. Best, Stéphane Le lundi 16 août 2021 à 11:54:36 UTC+2, Misterel85 a écrit : > Tones, > > Oh, now I

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-16 Thread Misterel85
Tones, Oh, now I better see what you mean by 'separating the data from its presentation'. It kind of reminds me of my attempts at concatenating genealogical data in LaTeX with AppleScript years ago. What you advise is something I more or less tried to do at the time. I fully agree with what

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread Joshua Fontany
We've found a bug! The wikitext parser object always tries to read Pragmas from the beginning to parse a text, and this _always_ trims whitespace from the text (moves the parser position past any leading whitespace). The $:/core/modules/parsers/wikiparser/wikiparser.js module needs to

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread TW Tones
Misterel, I believe I understand what you are trying todo. Yet I would persist in suggesting you separate the data from its presentation. Of course its is fine to use the pragmatic approach as you wish. What I would do is build the concatenation process to always include a space between

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread Misterel85
Yay, it works!!! Thank you very much for your quick reply and your simple and straightforward solution, Eric! After a bit of trial and error, I could adapt it to my TiddlyWiki. No need for an anymore indeed. Thanks again to all of you for your help, solutions, explanations and suggestions.

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread Eric Shulman
On Sunday, August 15, 2021 at 7:10:39 AM UTC-7 Misterel85 wrote: > I first thought there would have been a more straightforward solution to > that issue, but actually I come to think that it should be possible to > inspect the first character in the contents of field 2: > If value of field2

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread Misterel85
Thanks for your complementary explanation about order, Tones, and you're quite right. But as I wrote in a previous message, in that particular TW instance I am adamant that I won't change the field order. Concatenating / Joining snippets of text from two fields in immutable order, while

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread TW Tones
I think you can have your cake and eat it, as long as you use the tiddlywiki recipe/ingredients. First lets see if I can explain about order. If this was my first design (with space between them) <$transclude field="field1" /> <$transclude field="field2" /> And I decided I wanted; <$transclude

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread Misterel85
Thank you for your replies, PMario, Joshua and Tones. @ Joshua: Thanks a lot for taking the time to write this comprehensive and clear explanation. I have followed your solution to insert `\whitespace notrim` at the beginning of a tiddler text, but unfortunately, it doesn't work. I also tried

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread PMario
On Sunday, August 15, 2021 at 9:19:57 AM UTC+2 TW Tones wrote: > >- The spacing you wish is something best done in the display of the >data and not in the data, what if they changed order? > > I can only second that. If the data needs to be treated special, you will get a maintenance

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread TW Tones
Misterel Joshua does a great technical explanation here, and Mario gives the standard solution. - The spacing you wish is something best done in the display of the data and not in the data, what if they changed order? - A field containing a list of titles or tiddlers is typically

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-14 Thread Joshua Fontany
Hi Misterel85, This behaviour is found in https://tiddlywiki.com/#%24%3A%2Fcore%2Fmodules%2Fwidgets%2Ftransclude.js ``` /*\ title: $:/core/modules/widgets/transclude.js type: application/javascript module-type: widget Transclude widget \*/ ... var parser = this.wiki.parseTextReference(

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-14 Thread PMario
Hi, Try this: <$transclude field="foo" /> <$transclude field="bar" /> See the red space! It should do the trick -m -- 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