Skip to content

Commit

Permalink
https://github.com/iamacup/react-native-markdown-display/issues/79
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacup committed Jul 4, 2020
1 parent d560155 commit dce1c9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,10 @@ const Markdown = React.memo(
);

Markdown.propTypes = {
children: PropTypes.node.isRequired,
children: PropTypes.oneOfType([
PropTypes.node,
PropTypes.array,
]).isRequired,
renderer: PropTypes.oneOfType([
PropTypes.func,
PropTypes.instanceOf(AstRenderer),
Expand Down
4 changes: 4 additions & 0 deletions src/lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import groupTextTokens from './util/groupTextTokens';
* @return {View}
*/
export default function parser(source, renderer, markdownIt) {
if(Array.isArray(source)) {
return renderer(source);
}

let tokens = stringToTokens(source, markdownIt);
tokens = cleanupTokens(tokens);
tokens = groupTextTokens(tokens);
Expand Down

0 comments on commit dce1c9c

Please sign in to comment.