Skip to content

Commit

Permalink
fix slate mark rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
erquhart committed Dec 6, 2017
1 parent 2533b69 commit 9b2e51d
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ const Link = props => {
const title = data.get('title');
const link = <a href={url} title={title} {...props.attributes}>{props.children}</a>;
const result = !marks ? link : marks.reduce((acc, mark) => {
const MarkComponent = MARK_COMPONENTS[mark.type];
return <MarkComponent>{acc}</MarkComponent>;
return renderMark({ mark, children: acc });
}, link);
return result;
};
Expand All @@ -57,8 +56,7 @@ const Image = props => {
const alt = data.get('alt');
const image = <img src={url} title={title} alt={alt} {...props.attributes}/>;
const result = !marks ? image : marks.reduce((acc, mark) => {
const MarkComponent = MARK_COMPONENTS[mark.type];
return <MarkComponent>{acc}</MarkComponent>;
return renderMark({ mark, children: acc });
}, image);
return result;
};
Expand Down

0 comments on commit 9b2e51d

Please sign in to comment.