rivescript-python icon indicating copy to clipboard operation
rivescript-python copied to clipboard

Unable to reply with complex html

Open lynxionxs opened this issue 9 years ago • 2 comments

I want the bot to respond with small html bits when needed. But when i give it a few complex tags rivescript throws errors like [ERR: Math couldn't 'div' to value 'undefined' etc... Its json encoded aswell

lynxionxs avatar Aug 17 '16 08:08 lynxionxs

The <div> tag is used in RiveScript to divide numeric user variables.

I wouldn't recommend using HTML within RiveScript (unless it's returned by an object macro, where no further tags get processed on its output). If you must, use a different block-level tag such as <section> that isn't likely to be used in the future as a RiveScript special tag.

kirsle avatar Aug 17 '16 17:08 kirsle

I use html template responses in the router streams. I have to use html though, normal text replies is boring.

I did a search-replace on all <div> tags like, html.replace("div", "dxv"). Then on the client side restore <div>'s again. If there are more breaks i will do the same with those tags.

lynxionxs avatar Aug 17 '16 17:08 lynxionxs