I want to append some texts after specific letter,
so I made some script below
Macro.add('lr', {
tags : null,
handler: function() {
var content = this.payload[0].contents
var len = content.length - 1
var str = (content.charCodeAt(len));
if(str==108)
{str = content + "an"}
else if(str==114){str = content + "a"}
$(this.output).wiki(str);
}
});
in passage,
<<lr>>steal<</lr>>
<<lr>>ser<</lr>>
<<set $a to "steal">>
<<set $b to "ser">>
<<lr>>$a<</lr>>
<<lr>>$b<</lr>>
first case, which I wrote some text directly, it works perfectly
but with variables, it work with last letter of variabale name not contents of that.