Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bookmarklet fails on tt #9

Open
electrum opened this issue Oct 22, 2014 · 5 comments
Open

Bookmarklet fails on tt #9

electrum opened this issue Oct 22, 2014 · 5 comments

Comments

@electrum
Copy link

I tried the bookmarklet on http://cr.yp.to/ and it fails with this in the Chrome console:

 Uncaught Error: Something bad happened when transforming HTML to JSX: ReferenceError: tt is not defined
@Daniel15
Copy link
Member

This is because React doesn't recognise the <tt> element. React 0.11 and older has a whitelist of HTML tags that it recognises, and I guess tt is not one of them.

The RC of React 0.12 has removed this whitelist and instead treats all lowercase tags as HTML tags (see http://facebook.github.io/react/blog/2014/10/16/react-v0.12-rc1.html). Using React 0.12 instead of 0.11 should avoid this issue. Try using http://fb.me/react-0.12.0-rc1.min.js instead of 0.11 and see if that works for you.

@electrum
Copy link
Author

I tried that and got the same error.

@Daniel15
Copy link
Member

Oh I forgot to mention you'll probably have to update the JSXTransformer reference to point to 0.12 RC1 as well.

@zpao
Copy link
Member

zpao commented Oct 28, 2014

<tt> is obsolete. React still uses a whitelist for the time being in 0.12 (it's not gone completely yet), but we won't be adding support for obsolete tags.

@Daniel15
Copy link
Member

Oh, I didn't realise a whitelist was still used. I could work around this by converting <tt> to a different tag like <code> or something, but perhaps that's unexpected behaviour and will result in strangeness if they're using CSS rules explicitly targeting tt tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants