Skip to content

Commit

Permalink
[draft-js-import-markdown] fix links with complex sources
Browse files Browse the repository at this point in the history
Makes `href` matching of links and images non-greedy.

This fix is copied from markedjs/marked#600, and
fixes the failing tests submitted in the previous commit.
  • Loading branch information
mxstbr committed Oct 4, 2017
1 parent ac88044 commit 0c923d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/draft-js-import-markdown/src/MarkdownParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ var inline = {
};

inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;
inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;
inline._href = /\s*<?([\s\S]*)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;

inline.link = replace(inline.link)('inside', inline._inside)(
'href',
Expand Down

0 comments on commit 0c923d1

Please sign in to comment.