react-markdown
Advanced tools
Comparing version 3.5.0 to 3.6.0
@@ -5,2 +5,8 @@ # Change Log | ||
## 3.6.0 - 2018-09-05 | ||
### Added | ||
* Add support for passing index info to renderers (Beau Roberts) | ||
## 3.5.0 - 2018-09-03 | ||
@@ -7,0 +13,0 @@ |
@@ -71,2 +71,3 @@ // Type definitions for react-markdown > v3.3.0 | ||
readonly sourcePos?: boolean | ||
readonly includeNodeIndex?: boolean | ||
readonly rawSourcePos?: boolean | ||
@@ -73,0 +74,0 @@ readonly escapeHtml?: boolean |
@@ -53,2 +53,8 @@ 'use strict'; | ||
// If `includeNodeIndex` is true, pass node index info to all non-tag renderers | ||
if (opts.includeNodeIndex && parent.node && parent.node.children && !isTagRenderer) { | ||
props.index = parent.node.children.indexOf(node); | ||
props.parentChildCount = parent.node.children.length; | ||
} | ||
var ref = node.identifier !== null && node.identifier !== undefined ? opts.definitions[node.identifier] || {} : null; | ||
@@ -55,0 +61,0 @@ |
{ | ||
"name": "react-markdown", | ||
"description": "Renders Markdown as React components", | ||
"version": "3.5.0", | ||
"version": "3.6.0", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "markdown", |
@@ -62,2 +62,3 @@ # react-markdown | ||
* `rawSourcePos` - _boolean_ Setting to `true` will pass a `sourcePosition` property to all renderers with structured source position information (default: `false`). | ||
* `includeNodeIndex` - _boolean_ Setting to `true` will pass `index` and `parentChildCount` props to all renderers (default: `false`). | ||
* `allowedTypes` - _array_ Defines which types of nodes should be allowed (rendered). (default: all | ||
@@ -64,0 +65,0 @@ types). |
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
133331
706
142