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

no-undefined-references flags […] #207

Closed
davidchambers opened this issue Mar 9, 2019 · 4 comments · Fixed by #210
Closed

no-undefined-references flags […] #207

davidchambers opened this issue Mar 9, 2019 · 4 comments · Fixed by #210
Labels
🙋 no/question This does not need any changes

Comments

@davidchambers
Copy link
Contributor

$ npm install [email protected] [email protected]

$ echo 'foo [...] bar' >README.md

$ node_modules/.bin/remark --use remark-lint-no-undefined-references -- README.md
foo [...] bar
README.md
  1:5-1:10  warning  Found reference to undefined definition  no-undefined-references  remark-lint

⚠ 1 warning

I think I understand the problem. Certain Markdown parsers permit [x] as shorthand for [x][], which in turn is shorthand for [x][x], so ... in the example above is being treated as a link identifier.

Could we provide an option to skip such “links”? I'd like to be able to use […] when eliding a portion of a quoted passage. In the interim, what do you recommend as a workaround?

@davidchambers
Copy link
Contributor Author

In the interim, what do you recommend as a workaround?

Replacing […] with \[…] solves the problem, although it isn't pretty.

In my view, […] and [...] deserve to be treated specially so as not to be flagged. I'll be happy to submit a pull request if you agree.

@wooorm
Copy link
Member

wooorm commented Mar 10, 2019

The problem here is that if you now define [...], everything will become a link! Probably won't happen, but it's not what you want or expect. That's what this rule does: warn you about that possibility!

@davidchambers
Copy link
Contributor Author

Fair point. I think treating [x] as shorthand for [x][] is a mistake, but that wasn't your decision. ;)

@wooorm
Copy link
Member

wooorm commented Mar 10, 2019

I agree, but that's markdown! My decision was to add a rule for it saying that you shouldn't use it!

If you do know what you're doing, it's of course fine, like all style decisions, so if you want to create an exception, I'd accept a PR!

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

Successfully merging a pull request may close this issue.

2 participants