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

Don't check reference-style links #105

Closed
gregurco opened this issue Jul 25, 2018 · 1 comment · Fixed by #148
Closed

Don't check reference-style links #105

gregurco opened this issue Jul 25, 2018 · 1 comment · Fixed by #148

Comments

@gregurco
Copy link

gregurco commented Jul 25, 2018

Hello.
This rule is not validating links in reference-style. For example:

(some link text)[1]

[1]: https://foo.bar

Plugin is simply ignore it, but error expected.

@azu
Copy link
Member

azu commented Jul 25, 2018

Thanks for report.

This rule is not validating links in reference-style.

Yes. Currently this rule does not support it.

Probably, we can support reference-style by following imeplemtation.
(I did not test the code)

// Similar with https://github.com/textlint-rule/textlint-rule-no-dead-link/blob/3984344d642e0323903d6d34326d02f6a33be269/src/no-dead-link.js#L223
    ["Definition"](node) {
      if (typeof node.url === 'undefined') {
        return;
      }

      // [1]: http://example.com
      //      ^
      const index = node.raw.indexOf(node.url) || 0;

      URIs.push({
        node,
        uri: node.url,
        index,
      });
   },

📝 Note: Definition Node type is markdown specific.
(It is not a parts of TxtAST)

image

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

Successfully merging a pull request may close this issue.

2 participants