Sunday, March 20, 2011

Why is Google Chrome not converting tags/entities?

I keep running into this problem recurring, where Chrome refuses to parse tags/entities on text which is handed to it by JavaScript.

I first noticed it with entities like ". It will display " as opposed to "

Now I am also running into the problem with <strong> and <em>. It displays <strong>Text</strong> as opposed to bolding the text.

I am not having this trouble with any other browser. IE/FF/Safari/Opera all parse and display correctly.

Has anyone else run into this? Is it is bug? Am I doing something wrong? How can I work around it?

Anything would be appreciated. Thank you.

From stackoverflow
  • The first part of this problem I resolved by using jQuery's html() as opposed to text(). That fixed the tag parsing issue.

    The &quot; entity parsing I am still working on.

    Carl Smotricz : Do you really need to have `"` in the text you're inserting? Life would be simple if you could simply include quotes where needed. Remember, the entity is needed as an escape in HTML, but not in your JS.
    Spot : @Carl the data is user generated. They often use quotes when they are quoting something.

0 comments:

Post a Comment