Hey there,
I'm having an issue with the JavaScript for my Telegram Webhook. I'm using HTML markdown, so I have to substitute '<', '>' and '&' from the trigger name and operational data.
I still wanted to be able to use html markdown in the message template, so I used the following regex to match all '<', '>' and '&' characters that are not part of a html tag:
However, this fails at the third line, complaining about the regex. (This works in in chrome, btw, tested it in it's console)
The Duktape Engine version appears to be too old to support negative lookbehind. Which is quite unfortunate imo.
Can anybody help me with getting this to work?
Thank you in advance.
I'm having an issue with the JavaScript for my Telegram Webhook. I'm using HTML markdown, so I have to substitute '<', '>' and '&' from the trigger name and operational data.
I still wanted to be able to use html markdown in the message template, so I used the following regex to match all '<', '>' and '&' characters that are not part of a html tag:
Code:
var safesubject = params.Subject.replace(/&/g,'&'); safesubject = safesubject.replace(/<(?!\/?\w>)/g,"<"); safesubject = safesubject.replace(/(?<!<\/?\w)>/g,">"); var safemessage = params.Message.replace(/&/g,'&'); safemessage = safemessage.replace(/<(?!\/?\w>)/g,"<"); safemessage = safemessage.replace(/(?<!<\/?\w)>/g,">");
The Duktape Engine version appears to be too old to support negative lookbehind. Which is quite unfortunate imo.
Can anybody help me with getting this to work?
Thank you in advance.