Skip to content

Fixes #885 | Fix editor.on paste function and enhance REGEX_URL#886

Merged
julien merged 1 commit intoliferay:masterfrom
rolandpakai:LPS-85659
Oct 2, 2018
Merged

Fixes #885 | Fix editor.on paste function and enhance REGEX_URL#886
julien merged 1 commit intoliferay:masterfrom
rolandpakai:LPS-85659

Conversation

@rolandpakai
Copy link
Copy Markdown

@rolandpakai rolandpakai commented Sep 28, 2018

Prelude

The issue was introduce by the following commit:
"Adds a way to correct paste behavior of an URL"
32040b8

Issue

Pasting text from the clipboard which contains url(s) the first url is automatically moving to the beginning of the paragraph replacing with an anchor link. The other urls stay untached.

The issue is only reproducable when copying text from the clipboard

which has url(s)
and not contains new lines
and the text is not copied from the editor itself.
When typeing text in the editor the url(s) are replacing with anchor links correctly.

Solution

The original solution was wrong: only replaced the first url in the text and placed the anchor link to the beginning of the text.

I changed the REGEX_URL to find all the url occurrence in the text and i rewrited the paste function to replace all the urls in place with the anchor links. I also added the functionality to replace the valid emails with anchor links too.

https://issues.liferay.com/browse/LPS-85659

@jbalsas
Copy link
Copy Markdown
Contributor

jbalsas commented Oct 1, 2018

Hey @julien, could you review this? Once we get this in together with #887 we can release a new version.

Thanks!

@julien
Copy link
Copy Markdown
Contributor

julien commented Oct 2, 2018

Just started reviewing :)

:octocat: Sent from GH.

@julien julien merged commit 43b6522 into liferay:master Oct 2, 2018
@julien
Copy link
Copy Markdown
Contributor

julien commented Oct 2, 2018

Merged, thank you @rolandpakai

:octocat: Sent from GH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants