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

Cannot disable no-literal-urls #47

Closed
benbalter opened this issue Feb 13, 2016 · 3 comments
Closed

Cannot disable no-literal-urls #47

benbalter opened this issue Feb 13, 2016 · 3 comments
Labels
🙋 no/question This does not need any changes

Comments

@benbalter
Copy link
Contributor

Setting the no-literal-urls flag to false suppresses the warning, when running remark-lint, but if the output flag is set to true, all links are wrapped with < and > tags, regardless of the no-literal-urls flag.

This is especially troublesome when gfm is set to true, as GFM supports autolinking, and thus theoretically the parser shouldn't rewrite the links when outputting.

Example (with gfm: true and no-literal-urls: false):

Input:

Link to example.com.

Expected:

Link to example.com.

(Identical)

Actual:

Link to <example.com>.
@wooorm
Copy link
Member

wooorm commented Feb 13, 2016

Nice going, @benbalter! 👍

As it stands, remark-lint and remark are decoupled, so the settings don’t carry over from remark-lint to remark.

The reason for the extra angle brackets is because not every flavour of markdown supports literal URLs, so, remark (trying to be the hero), ensures other flavours will understand what you meant too.

In writing remark, at the parser level I tried to ensure everything of the users settings is supported (so literal URLs, being part of GFM, are of course read correctly), but in compiling remark tries to support as many as possible flavours.

To be honest, although I’m unaware of your reason for wanting literal URLs, I’d say to just change your views and start preferring angle brackets. 😉 Without them, you run into all kinds of problems. For example, npm now has a bug where readme.md is linked to that actual, Moldavian, site!

If you don’t agree, I’d like to know why :)

@benbalter
Copy link
Contributor Author

To be honest, although I’m unaware of your reason for wanting literal URLs, I’d say to just change your views and start preferring angle brackets.

Ha. Makes sense. That works for me. Thanks, once again, for the thorough response.

@wooorm
Copy link
Member

wooorm commented Feb 13, 2016

👌

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