Page 1 of 1

Syntax rejection issues with HTML encoding in text editor

Posted: Thu Oct 11, 2018 2:58 am
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?

Re: Syntax rejection issues with HTML encoding in text edito

Posted: Thu Oct 11, 2018 3:42 am
by ChoccieMuffin
Where does your & appear? It's not in the bit of code you gave us.

Re: Syntax rejection issues with HTML encoding in text edito

Posted: Thu Oct 11, 2018 4:14 am
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)

Re: Syntax rejection issues with HTML encoding in text edito

Posted: Thu Oct 11, 2018 5:54 am
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:

Re: Syntax rejection issues with HTML encoding in text edito

Posted: Fri Oct 12, 2018 4:38 pm
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.