From 987012369daa4dbe053e9da53b79f3ebb9d6d46c Mon Sep 17 00:00:00 2001 From: David Owens Date: Sun, 5 Nov 2017 19:17:20 +0100 Subject: [PATCH] Use contentWrapper prop to define the wrapper for the parsed content following from https://github.com/acdlite/react-remarkable/issues/24 https://github.com/acdlite/react-remarkable/pull/25 --- src/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 46c7336..9573566 100644 --- a/src/index.js +++ b/src/index.js @@ -22,13 +22,15 @@ class Remarkable extends React.Component { } content() { + var Wrapper = this.props.contentWrapper; + if (this.props.source) { - return ; + return ; } else { return React.Children.map(this.props.children, child => { if (typeof child === 'string') { - return ; + return ; } else { return child; @@ -48,6 +50,7 @@ class Remarkable extends React.Component { Remarkable.defaultProps = { container: 'div', + contentWrapper: 'span', options: {}, };