Quotes in scripts are converted to entities
-
Hello,
I have repeatedly tried inserting a piece of Javascript in an article. This script contains a call to a function with arguments, enclosed in quotes.
This does not work: upon looking at the source of the resulting page, I see that the quotes (single or double) are converted to HTML entities (
&
#8217; and&
#8221;). Sometimes, this happens to just the first argument, while the second one has the correct quotes, sometimes to all. I haven’t been able to determine what the logic is, bur regardless, at least the first pair of quotes is thus changed, and the script fails.If I put this very same call into an image
onLoad
attribute, no argument is changed (but I can’t leave it that way, due to the logic of the script: it has to be outside the image).This transformation of the quotes occurs when the page is loaded for display. The code in the underlying database is correct.
Searching back in the bugs, I have seen something similar reported at least twice, but with no solution provided. Any help, please?
Thanks.
PS: I think it may have something to do with parentheses: in the paragraph above, the two entity codes provided in parentheses were treated differently when in backticks around the whole parenthetical comment: the first had its pound sign removed.
- The topic ‘Quotes in scripts are converted to entities’ is closed to new replies.