react-markdown
Advanced tools
Comparing version 4.0.6 to 4.0.7
@@ -5,2 +5,10 @@ # Change Log | ||
## 4.0.7 - 2019-04-14 | ||
### Fixes | ||
* Fix matching of replaced non-void elements in HTML parser plugin (Nicolas Venegas) | ||
* Fix HTML parsing of multiple void elements (Nicolas Venegas) | ||
* Fix void element children invariant violation (Nicolas Venegas) | ||
## 4.0.6 - 2019-01-04 | ||
@@ -7,0 +15,0 @@ |
@@ -173,12 +173,20 @@ 'use strict'; | ||
case 'parsedHtml': | ||
props.escapeHtml = opts.escapeHtml; | ||
props.skipHtml = opts.skipHtml; | ||
props.element = mergeNodeChildren(node, (node.children || []).map(function (child, i) { | ||
return astToReact(child, opts, { | ||
node: node, | ||
props: props | ||
}, i); | ||
})); | ||
break; | ||
{ | ||
var parsedChildren; | ||
if (node.children) { | ||
parsedChildren = node.children.map(function (child, i) { | ||
return astToReact(child, opts, { | ||
node: node, | ||
props: props | ||
}, i); | ||
}); | ||
} | ||
props.escapeHtml = opts.escapeHtml; | ||
props.skipHtml = opts.skipHtml; | ||
props.element = mergeNodeChildren(node, parsedChildren); | ||
break; | ||
} | ||
default: | ||
@@ -215,4 +223,8 @@ assignDefined(props, xtend(node, { | ||
var children = (el.props.children || []).concat(parsedChildren); | ||
return React.cloneElement(el, null, children); | ||
if (el.props.children || parsedChildren) { | ||
var children = (el.props.children || []).concat(parsedChildren); | ||
return React.cloneElement(el, null, children); | ||
} | ||
return React.cloneElement(el, null); | ||
} | ||
@@ -219,0 +231,0 @@ |
@@ -20,2 +20,3 @@ "use strict"; | ||
var selfClosingRe = /^<(area|base|br|col|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)\s*\/?>$/i; | ||
var startTagRe = /^<([a-z]+)\b/i; | ||
var closingTagRe = /^<\/([a-z]+)\s*>$/; | ||
@@ -72,3 +73,3 @@ var parser = new HtmlToReact.Parser(); | ||
if (!current) { | ||
if (!current || current.type === type) { | ||
return true; | ||
@@ -148,4 +149,6 @@ } | ||
var startTagMatch = node.value.trim().match(startTagRe); | ||
var tag = startTagMatch ? startTagMatch[1] : el.type; | ||
return { | ||
tag: el.type, | ||
tag: tag, | ||
opening: true, | ||
@@ -152,0 +155,0 @@ node: node, |
{ | ||
"name": "react-markdown", | ||
"description": "Renders Markdown as React components", | ||
"version": "4.0.6", | ||
"version": "4.0.7", | ||
"keywords": [ | ||
@@ -21,5 +21,5 @@ "markdown", | ||
"posttest": "eslint .", | ||
"prepublishOnly": "npm run qa", | ||
"prepublishOnly": "npm run build", | ||
"qa": "npm test && npm run build", | ||
"test": "jest --coverage", | ||
"test": "jest --coverage --env=jsdom", | ||
"watch": "webpack --watch", | ||
@@ -59,2 +59,4 @@ "watch:demo": "webpack --watch --config webpack.config.demo.js" | ||
"babel-plugin-transform-react-remove-prop-types": "^0.4.20", | ||
"enzyme": "^3.9.0", | ||
"enzyme-adapter-react-16": "^1.12.1", | ||
"eslint": "^5.6.0", | ||
@@ -61,0 +63,0 @@ "eslint-config-prettier": "^3.1.0", |
@@ -5,3 +5,3 @@ # react-markdown | ||
[![npm version](https://img.shields.io/npm/v/react-markdown.svg?style=flat-square)](http://browsenpm.org/package/react-markdown)[![Build Status](https://img.shields.io/travis/rexxars/react-markdown/master.svg?style=flat-square)](https://travis-ci.org/rexxars/react-markdown) | ||
[![npm version](https://img.shields.io/npm/v/react-markdown.svg?style=flat-square)](https://www.npmjs.com/package/react-markdown)[![Build Status](https://img.shields.io/travis/rexxars/react-markdown/master.svg?style=flat-square)](https://travis-ci.org/rexxars/react-markdown) | ||
@@ -111,3 +111,3 @@ Demo available at https://rexxars.github.io/react-markdown/ | ||
escapeHtml={false} | ||
> | ||
/> | ||
``` | ||
@@ -132,3 +132,3 @@ | ||
astPlugins={[parseHtml]} | ||
> | ||
/> | ||
``` | ||
@@ -135,0 +135,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
116636
977
28