Skip to content

HTMLtoJSX does not convert curly brackets #42

@optimalisatie

Description

@optimalisatie

Issue copied from React:Issues.

I am experiencing a problem with the HTMLtoJSX converter (https://www.npmjs.com/package/htmltojsx), the same converter as officially displayed on https://facebook.github.io/react/html-jsx.html.

The HTML-code <div>{</div> is compiled to the following JSX-code:

<div>{</div>

https://facebook.github.io/react/html-jsx.html

The JSX code fails with the following error:

Uncaught SyntaxError: embedded: Unexpected token (7:18)
   5 | var Hello = React.createClass({
   6 |   render: function() {
>  7 |     return <div>{</div>;
     |                   ^
   8 |   }
   9 | });

Test: https://jsfiddle.net/69z2wepo/28714/

Does anyone know a solution for the problem?


Reply from @Daniel15
Good catch, thanks for reporting this! As @zpao mentioned, please file this in the react-magic repo so I remember to fix it :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions