Skip to content

Empty element is not handled correctly by dangerouslySetInnerHTML #854

Closed
@yapcheahshen

Description

@yapcheahshen

React version 0.8.0

"<tag></tag>normal text <tag/> normal text <tag>red</tag> normal text"

become

"<tag></tag>normal text <tag> normal text <tag>red</tag> normal text</tag>"

in DOM.
"normal text" should not be red in the following example.

  var NullTag = React.createClass({
    render: function() {
      html="<tag></tag>normal text <tag/> normal text <tag>red</tag> normal text";
      return  React.DOM.div( {dangerouslySetInnerHTML:{__html: html}} )
    }
  });

nulltag

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions