Manual edits to HTML are broken by Publii
- This topic has 5 replies, 2 voices, and was last updated 1 month ago by .
- December 4, 2021 at 11:07 pm #6613lps
Is anyone having an issue where manual HTML edits in the WISIWIG editor are being broken after apply changes is pressed?
Ampersand (&) symbols in links are being destroyed by the editor
Example: . . . server&qid= . . .
is being replaced with: . . . server&qid . . .
The above code sample is part of an href image link.December 4, 2021 at 11:10 pm #6614lps
The same thing happens when you insert an image. If the link contains an &, it is changed.December 11, 2021 at 3:30 pm #6637Tomasz Dziuda
I will try to diagnose this issue and try to fix it. Seems to be some compatibility layer for XHTML.December 12, 2021 at 7:20 am #6645Tomasz Dziuda
I have made a deeper research of this topic, and the described behaviour is correct even in HTML5: https://stackoverflow.com/questions/19441750/do-ampersands-still-need-to-be-encoded-in-urls-in-html5
In short – such replacement is used to protect before a case when param name is similar to existing named entities what can confuse older browser.
Also such behaviour does not broke links so in fact you can ignore it.December 14, 2021 at 1:51 am #6647lps
Have you tried putting a link with an ampersand into the application and then trying to click through on the link? What I am seeing is that the & is being escaped by the application. If you copy and paste custom code into the application go back to the WYSIWYG editor or save the page as an HTML file the link is broken.December 22, 2021 at 9:10 pm #6703Tomasz Dziuda
- You must be logged in to reply to this topic.