It is known that the newline character is different for different OS (see Wikipedia). I am not sure if this is also true for the browsers or not!
Having that said, what is the best practice to treat a newline character in a Tiddlywiki filter to work everywhere!Case i<$list filter="[<source>splitregexp[\n]]" ...
Case ii<$vars newline="" ><$list filter="[<source>splitregexp<newline>]" ...
--
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 tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/2ea136f8-0151-48dc-bf9a-f4a75b7865d4n%40googlegroups.com.
Mohammad: I am speaking of really very old MacOS from circa 1990.Mac from BSD era on are decent OS with \n end-of-lines as all unixes.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/5ed0e0a6-2ea2-45dc-847f-3372e83ce243n%40googlegroups.com.
just to be pedantic, but in old Mac'OS the end of line was only \r. so your code would not work there$list filter="[<source>splitregexp[(\r?\n|\r)]"will do that (not tested yet). we obviously cannot use [\r?\n?]
filter="[<source>splitregexp[\r?\n|\r]]Le jeudi 29 avril 2021 à 13:48:01 UTC+2, PMario a écrit :On Thursday, April 29, 2021 at 12:26:23 PM UTC+2 Mohammad wrote:It is known that the newline character is different for different OS (see Wikipedia). I am not sure if this is also true for the browsers or not!1) If you save a multiline tiddler in TW to the internal store `\n` will be used.2) If you copy paste content from a file to TW it will use \n3) If you import eg: test.txt from windows there will be "\r\n" in the tiddler.The next time you edit the tiddler and save there will be "\n" only.Having that said, what is the best practice to treat a newline character in a Tiddlywiki filter to work everywhere!Case i<$list filter="[<source>splitregexp[\n]]" ...So for case 3 it will look like, if it works, but it will keep the \r in memory.If you want to remove it use:<$list filter="[<source>splitregexp[\r?\n]]" ... this will always work for all OSes.\r? .. means check for \r optional ... only if it existsCase ii<$vars newline="" ><$list filter="[<source>splitregexp<newline>]" ...hmm. This won't help since internally we only use \nhope that helpsmario
--