Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix regex doesn't found matches when carriage return(\r) included #9

Closed
wants to merge 1 commit into from
Closed

Conversation

heyask
Copy link

@heyask heyask commented Oct 28, 2019

if string contains \r, then regex cannot find matches.

I tried to edit regex to make matching job to work, I couldn't.

so I added code that remove all \r characters.

I think RegExp() class of dart has bug.

dotAll: true options also doesn't work.

below is test strings. try test.

text = "test_link1: \nhttps://github.com/\ntest_link2 : \nhttps://github.com/"

=> working

text = "test_link1: \r\nhttps://github.com/\r\ntest_link2 : \r\nhttps://github.com/"

=> not working

@Cretezy
Copy link
Owner

Cretezy commented Dec 29, 2019

Sorry I didn't see this before. It should match [\n|\r] instead of replacing it.

If you want to update your PR with the new parsers, I can merge

@RedyAu
Copy link

RedyAu commented May 22, 2020

I don't know if this issue with the carriage return character is still relevant, but it did cause a minor headache for me. So a simple workaround for anybody in the same situation:
myString.replaceAll("\r", "")
Do this to the string in the text: property of your Linkify()

@Cretezy
Copy link
Owner

Cretezy commented Nov 6, 2020

This has been resolved with #26 in 63e97d5

@Cretezy Cretezy closed this Nov 6, 2020
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.

None yet

3 participants