Hi,

I try to append to the text of $:/DefaultTiddlers a new line. I get the 
content of this tiddler via following souce and add new text:

<!--
> set in variable text a search pattern / adding-text
> -->
> <$set name="tag" value="[all[]has:field[atc.pinned]]">
>     <!--
>     Get $:/DefaultTiddlers!!text
> split result at LF to breakup the resulting string into a list
> search in resulting list for content of variable tag
> count result
> save result in variable existingEntry
>    -->
>
    <
> $list variable="existingEntry" 
> filter="[[$:/DefaultTiddlers]get[text]splitregexp:m[\n]search::literal
> <tag>count[]]">
>         <!-- if variable existingEntry = 0 -->
>         <$list filter="[<existingEntry>match[0]]">
> <!--
> get content of $:/DefaultTiddlers!!text
> encode it into a JSON-String (in addition escaping LFs as "\n")
> append "\n" (to get a new line / LF)
> append variable tag
> save result to variable "newDefaultTiddlers"
> -->
>             <$list
>   variable="newDefaultTiddlers"
> filter="[[$:/DefaultTiddlers]get[text]jsonstringify[]addsuffix[\n]addsuffix
> <tag>]">
>                 <<newDefaultTiddlers>>
>             </$list>
>         </$list>
>     </$list>
> </$set>
>  
>

So, I have now a JSON-encoded string. question is, how to get back a normal 
string with interpreted escape-sequences to replace the content of 
$:/DefaultTiddlers!!text with the new string.

Thanks for help

Cheers

ToraxMalu


-- 
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/173e9937-90ef-476d-8e80-fde2f77faa34%40googlegroups.com.

Reply via email to