Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v2.0.0
### Breaking Changes
- ReactHtmlParser now decodes html entities by default
- html, head and body tags are no longer automatically converted to div tags
### Updates
- Add React v16 as a peer dependency
- Added options parameter to ReactHtmlParser function with `decodeEntities` option (default true)
Expand Down
3 changes: 1 addition & 2 deletions src/elementTypes/TagElementType.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import ProcessNodes from '../utils/ProcessNodes';
import GeneratePropsFromAttributes from '../utils/GeneratePropsFromAttributes';
import TransformTagName from '../utils/TransformTagName';
import VoidElements from '../dom/elements/VoidElements';

/**
Expand All @@ -17,7 +16,7 @@ export default function TagElementType(node, key) {
const props = GeneratePropsFromAttributes(node.attribs, key);

// transform the tag name if needed
const tagName = TransformTagName(node.name);
const tagName = node.name;

// If the node is not a void element and has children then process them
let children = null;
Expand Down
20 changes: 0 additions & 20 deletions src/utils/TransformTagName.js

This file was deleted.

12 changes: 0 additions & 12 deletions test/integration/integration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,6 @@ describe('Integration tests: ', () => {
test(`<div style="border-radius:1px;background:red${trailingSemiComma}">test</div>`);
});

it('should transform a html tag to a div', () => {
test('<html>test</html>', '<div>test</div>');
});

it('should transform a head tag to a div', () => {
test('<head>test</head>', '<div>test</div>');
});

it('should transform a body tag to a div', () => {
test('<body>test</body>', '<div>test</div>');
});

it('should not allow nesting of void elements', () => {
test('<img><p>test</p></img>', '<img/><p>test</p>');
});
Expand Down
14 changes: 0 additions & 14 deletions test/unit/utils/TransformTagName.spec.js

This file was deleted.