Skip to content

changed regex to allow parenthesis in link names - #600

Closed
RemiArnaud wants to merge 1 commit into
markedjs:masterfrom
RemiArnaud:master
Closed

RemiArnaud wants to merge 1 commit into
markedjs:masterfrom
RemiArnaud:master

Conversation

@RemiArnaud

Copy link
Copy Markdown

Before the patch, this:
blabla would generate incorrect href="link(text"

now it generate href="link(text)"

The fix is to make the regex greedy, so it takes all the characteres in the href until the last ')'

@AlastairTaft

Copy link
Copy Markdown

+1 Just hit this with inline images

@adam-lynch

Copy link
Copy Markdown

If I understand correctly and this would fix the fact that https://en.wikipedia.org/wiki/Football_(disambiguation) autolinks to <a href="https://en.wikipedia.org/wiki/Football_(disambiguation">https://en.wikipedia.org/wiki/Football_(disambiguation</a>), then a big 👍

@RemiArnaud

Copy link
Copy Markdown
Author

Yes it does

shiren added a commit to nhn/marked that referenced this pull request Aug 12, 2016
mxstbr added a commit to mxstbr/draft-js-utils that referenced this pull request Oct 4, 2017
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.
sstur pushed a commit to sstur/draft-js-utils that referenced this pull request Oct 5, 2017
* [draft-js-import-markdown] replicate issue with complex image sources

* [draft-js-import-markdown] fix links with complex sources

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.

* Fix linting

* make the tooling happy
@joshbruce joshbruce added this to the 0.4.0 - No known defects milestone Dec 25, 2017
@joshbruce

Copy link
Copy Markdown
Member

#984

@joshbruce

Copy link
Copy Markdown
Member

Closing due to merge conflicts and missing tests.

@joshbruce joshbruce closed this Jan 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants