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

Incorrectly fixes URLS #73

Closed
ghost opened this issue Apr 29, 2019 · 11 comments
Closed

Incorrectly fixes URLS #73

ghost opened this issue Apr 29, 2019 · 11 comments
Labels

Comments

@ghost
Copy link

ghost commented Apr 29, 2019

i have this:

Ontology

  • A [RDF triple store] (https://en.wikipedia.org/wiki/Triplestore) based storage to provide a dynamically expanding ontology for the many types.
  • Localised using open standards ( i18n and l10N ) to provide real time language translation.

It says finds that i have Bare URLS. See: https://github.com/DavidAnson/markdownlint/blob/v0.13.0/doc/Rules.md#md034

But when i ask it to fix it i get this (NOTE where it puts the ">" !)

Ontology

  • A [RDF triple store] (https://en.wikipedia.org/wiki/Triplestore) based storage to provide a dynamically expanding ontology for the many types.
  • Localised using open standards ( i18n and l10N ) to provide real time language translation.
@DavidAnson
Copy link
Owner

The two examples are getting formatted by GitHub and look the same to me. Could you please put them in a code fence or indent them so they don’t get formatted? Thank you!

@cewbdex
Copy link

cewbdex commented May 2, 2019

image

Same here.

EDIT: I converted creole to md and there was the same link multiple times, I fixed the first one, but linter did not lint the other ones, just the first one, even if it was fixed.

image

@DavidAnson
Copy link
Owner

I’m working on some improvements to this rule as part of a change to the core project right now. That may help. I will try to reproduce your problem specifically. If you have a link to a file or repository to test with, that would save me some typing!

@DavidAnson
Copy link
Owner

The detection of a bare link seems to be due to Creole link syntax being unrecognized. Here is an example: https://dlaa.me/markdownlint/#%25m%23%20Issue%2073%0A%0AThis%20is%20a%20%5B%5Bhttps%3A%2F%2Fen.m.wikipedia.org%2Fwiki%2FCreole_(markup)%7CCreole%5D%5D%20link.

That’s not something I will change because it’s correctly detecting a bare link in Markdown.

However, the confusing thing is that the highlighting is wrong. That is something I’m hoping to improve!

@gedw99, is this the same scenario you have?

@cewbdex
Copy link

cewbdex commented May 2, 2019

But it detects bare link at the fixed one (detects it as wrong even after I fixed it) and it does not detect the next incorrect ones, it may cached or something.

@DavidAnson
Copy link
Owner

Rules only fire once per line, reporting the first problem they find. There is a bare link (Creole style) at the end of the line in the example in your image above and the rule is correctly identifying a problem on that line but INcorrectly highlighting the first link on that line. (At least that’s what it looks like from my phone on the bus.) If you have more examples, please share and I will review them all this evening.

@DavidAnson
Copy link
Owner

I found how to capture the Markdown of the original issue.

This:

- A [RDF triple store] (https://en.wikipedia.org/wiki/Triplestore) based storage to provide a dynamically expanding ontology for the many types.

Becomes:

- A [RDF triple store] (<https://en.wikipedia.org/wiki/Triplestore)> based storage to provide a dynamically expanding ontology for the many types.

@DavidAnson
Copy link
Owner

The problem with the original issue is that it is not a valid Markdown link due to the space between the text and URL: https://dlaa.me/markdownlint/#%25m%23%20Issue%2073%0A%0A-%20A%20%5BRDF%20triple%20store%5D%20(https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FTriplestore)%20based%20storage%20to%20provide%20a%20dynamically%20expanding%20ontology%20for%20the%20many%20types.

The “auto fix” for that isn’t ideal, but it isn’t clearly wrong, either. What would have been more helpful would be a new rule to detect the invalid link syntax. I’ve made a note to look into that some day.

@DavidAnson
Copy link
Owner

@CornyjK, your issue should be addressed once DavidAnson/markdownlint#181 makes it into a markdownlint release and the extension's package dependency gets updated.

@DavidAnson
Copy link
Owner

Closing issue as the original behavior seems to have been basically by design and detecting that flavor of invalid link may be handled by a future rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants