vale icon indicating copy to clipboard operation
vale copied to clipboard

Have an issue with URLs? Read this first.

Open jdkato opened this issue 5 years ago • 0 comments

About

Since URL handling is one of the most discussed topics on this issue tracker, I've made a guide to explain some of the most common problems.

URLs in markup (HTML, Markdown, AsciiDoc, reStructuredText, ...)

In all supported markup formats, Vale lints URLs according to the following structure:

<a href="url">text</a>

where url is ignored and text is linted. This behavior is consistent with Vale's practice of linting all user-facing text.

Markdown

[this is a link](https://example.com)

this is a link is linted; https://example.com is not.

[example.com](https://example.com)

example.com is linted; https://example.com is not.

<!-- These links are syntactically equivalent -->

<https://example.com>

[https://example.com](https://example.com)

https://example.com (the text) is linted; https://example.com (the URL) is not.

[`https://example.com`](https://example.com)

Neither https://example.com (the code span) nor https://example.com (the URL) are linted.

AsciiDoc

Head over to xref:ruby.adoc[our page on Ruby].

our page on Ruby is linted; xref:ruby.adoc is not.

https://example.com[Click here]

Click here is linted; https://example.com is not.

// These links are syntactically equivalent 

https://github.com/asciidoctor/asciidoctor

<a href="https://github.com/asciidoctor/asciidoctor" class="bare">https://github.com/asciidoctor/asciidoctor</a>

https://github.com/asciidoctor/asciidoctor (the text) is linted; https://github.com/asciidoctor/asciidoctor (the URL) is not. In this case, you choose to ignore the class bare.

https://example.com[`https://example.com`]

Neither https://example.com (the code span) nor https://example.com (the URL) are linted.

URLs in source code

There is currently no support for ignoring URLs in source code. #249 tracks adding this feature.

Still having issues?

If you still believe Vale is mishandling a URL, please open an issue with your .vale.ini and the file in question (the entire file, if possible).

jdkato avatar Jan 22 '21 19:01 jdkato