Syntax rejection issues with HTML encoding in text editor

This forum is for all Flare issues not related to any of the other categories.
Post Reply
DoTheWriteThing
Propeller Head
Posts: 27
Joined: Mon May 14, 2018 6:21 am

Syntax rejection issues with HTML encoding in text editor

Post by DoTheWriteThing »

Yesterday I tried insert a mailto link with a subject and body tag; it was rejected by the Flare syntax editor.

This was what I was trying to get past the syntax checker:

mailto:customerservice@madcapsoftware.com?Subject=Support%20Request&body=My%20Support%20Key

The error was: '=' Is an unexpected token, the expected token is ';'

By process of elimination I found that the issue was caused by the & character.

Any ideas?
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Syntax rejection issues with HTML encoding in text edito

Post by ChoccieMuffin »

Where does your & appear? It's not in the bit of code you gave us.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Syntax rejection issues with HTML encoding in text edito

Post by NorthEast »

In XML editor (not text mode), insert a hyperlink to a Website (not Email), and copy/paste your mailto code - it'll work.

If you do enter the link manually in text mode, you need to replace the & with & - doing it the way above converts all that for you.
ChoccieMuffin wrote:Where does your & appear? It's not in the bit of code you gave us.
Specsavers? ;0)
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Syntax rejection issues with HTML encoding in text edito

Post by ChoccieMuffin »

Dave Lee wrote:In XML editor (not text mode), insert a hyperlink to a Website (not Email), and copy/paste your mailto code - it'll work.

If you do enter the link manually in text mode, you need to replace the & with & - doing it the way above converts all that for you.
ChoccieMuffin wrote:Where does your & appear? It's not in the bit of code you gave us.
Specsavers? ;0)
8)

D'oh!!! :mrgreen:
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
ccahuber13
Jr. Propeller Head
Posts: 2
Joined: Fri Oct 12, 2018 4:31 pm

Re: Syntax rejection issues with HTML encoding in text edito

Post by ccahuber13 »

Hello,

Falre's editor is XML which does not allow certain characters. XML syntax is VERY strict compared to regular HTML. There are special characters you must escape and is one of them.
XML escaped characters
Special character escaped form gets replaced by
Ampersand & &
Less-than < <
Greater-than > >
Quotes " "

Replace any & with &amp

- WORK AROUND
If this solution does not work for you I've bypassed some of the editor issues by using an outside editor such as Visual Studio Code. In some cases you will need to publish first, then open the published page, make the edit with an outside editor. The downside to this is each time you publish it will be overwritten and must be changed. It's terrible but works in very small cases.

Alternatively, you can jQuery to append or insert inner HTML where you want the link. $("select element").append('<a href="www.google.com">MyLink</a>'); - This places a child element to the parent selector.
Post Reply