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

Ignore URLs? #10

Closed
cfreeley opened this issue May 2, 2017 · 4 comments
Closed

Ignore URLs? #10

cfreeley opened this issue May 2, 2017 · 4 comments
Labels
🙋 no/question This does not need any changes

Comments

@cfreeley
Copy link

cfreeley commented May 2, 2017

Hello, I've been using this (and a number of your other retexts!) and it's been working great except sometimes the strings in question have URLs in them which always get flagged. I'm not sure if this is a problem that I should handle on my end (and if so, I would love any advice you have), but if you think it would be useful, perhaps there could be an 'ignoreURL' or even 'ignoreRegex' option?

Perhaps you could use something like https://www.npmjs.com/package/valid-url if you were to add this in.

@wooorm
Copy link
Member

wooorm commented May 2, 2017

Is there a reason why you’re not using remark or rehype as a base? If your text contains links, it may just be markdown, and you could us remark/remark-retext/retext, like in this example: https://github.com/unifiedjs/unified#programming-interface

@wooorm
Copy link
Member

wooorm commented May 4, 2017

@cfreeley Any thoughts on this?

@cfreeley
Copy link
Author

cfreeley commented May 4, 2017

It's not markdown, but I do understand your point- text is text, so the special cases should probably be made with that in mind. It's just with my use case, people will sometimes put just a URL, or an email address, or something, inside these documents that are all text 99% of the time. So I wasn't sure where the best place to resolve this was.

@wooorm
Copy link
Member

wooorm commented May 8, 2017

You could use remark, and only enable some of the rules? I laid that out in remarkjs/remark#248. I think that may be the best solution

There used to be a plugin for this: retext-link, but I felt it was weird to combine syntax with natural language.

Let me know if you’ve got further questions!

@wooorm wooorm closed this as completed May 8, 2017
@wooorm wooorm added the 🙋 no/question This does not need any changes label Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes
Development

No branches or pull requests

2 participants