I wrote a javascript macro for converting html into TW5 markup. It works 
fine when I run it on a tiddler with a known name. But when I tried to 
launch it it from a form, it never gets the text -- even though the macro 
itself sitting on it's own line will run perfectly.

In the form, I collect the name of the tiddler containing the HTML to be 
converted. The name is stored in a system tiddler. The various macros are 
meant to fetch the contents of the named tiddler. The variable 
"text2convert" contains the original text. The ht2ml2tw expects to see 
variable "text2convert".  

I don't understand why adding one level of abstraction should break 
everything.

Thanks for any help!
Mark

This is the launcher code which doesn't work:

\define convertto() $(name_of_tiddler)$-converted
\define textin(tname) {{$tname$}}
\define textin2() <$macrocall $name="textin" tname="""$(name_of_tiddler)$"""
/>

<$edit-text tiddler="$:/html2tw/title" rows="1" size="50" placeholder="Name 
of tiddler to convert"  tag="input"   ></$edit-text>

<$set name="name_of_tiddler"  value={{$:/html2tw/title}}> 
<$set name="text2convert"  value=<<textin2>>  >
<$button>
<$action-setfield 
    $tiddler=<<convertto>> 
    text=<<html2tw>>   />
<$action-navigate $to=<<convertto>>/>
Convert Tiddler Text
</$button>

<p/>Using text from ''<<name_of_tiddler>>'' and sending to ''<<convertto>>''
. 

The following macro displays fine here:
<<html2tw>>

</$set>
</$set>


This is the earlier code, with hard-wired tiddler names that does work. :

<$set name="text2convert"  value={{HTML2TW: Incoming HTML!!text}}>

<$button>
<$action-setfield 
    $tiddler="HTML2TW: Converted Text" 
    text=<<html2tw>>   />
Convert Tiddler Text via action-setfield
</$button>
</$set>


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fb0e630f-0b45-4fd6-9c4c-28fd4324f777%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to