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

InvalidLinkBear fails on URLs in Markdown link display text and target #1338

Closed
ghost opened this issue Jan 23, 2017 · 6 comments
Closed

InvalidLinkBear fails on URLs in Markdown link display text and target #1338

ghost opened this issue Jan 23, 2017 · 6 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Jan 23, 2017

[http://harelba.github.io/q/](http://harelba.github.io/q/)
Markdown files have links generally in this form...
InvalidLinkBear [http://harelba.github.io/q/](http://harelba.github.io/q/) takes this as a link to check
However it should only check http://harelba.github.io/q/

@ghost
Copy link
Author

ghost commented Jan 23, 2017

The exact line in the markdown file was q's web site is [http://harelba.github.io/q/](http://harelba.github.io/q/). It contains everything you need to download and use q in no time.

However coala output was

|    | [NORMAL] InvalidLinkBear:
|    | Broken link - unable to connect to http://harelba.github.io/q/](http://harelba.github.io/q/) (HTTP Error: 404)
|    | *0: Do nothing
|    |  1: Open file(s)
|    |  2: Add ignore comment
|    | Enter number (Ctrl-D to exit):```

@sils
Copy link
Member

sils commented Jan 23, 2017

what's the source line?

@sils sils added the type/bug label Jan 23, 2017
@sils sils added this to the 0.10 milestone Jan 23, 2017
@coala-bot coala-bot assigned ghost Jan 23, 2017
@jayvdb
Copy link
Member

jayvdb commented Jan 23, 2017

This was found as part of CI1 (See spreadsheet).
Which version of the docker image were you using?

https://github.com/harelba/q is the repo.

The line is https://github.com/harelba/q/blame/master/README.markdown#L6

The problem is the second url in [http://harelba.github.io/q/](http://harelba.github.io/q/).

@jayvdb jayvdb changed the title InvalidLinkBear fails on some valid links InvalidLinkBear fails on URLs in Markdown link display text and target Jan 23, 2017
@jayvdb
Copy link
Member

jayvdb commented Jan 23, 2017

I think we need to start looking beyond managing a complex regex internally.
#1342

@ghost
Copy link
Author

ghost commented Jan 24, 2017

@jayvdb I used

language: generic
services: docker
script: docker run -v=$(pwd):/app --workdir=/app coala/base coala --ci

in .travis.yml file. I used http://coala.readthedocs.io/en/latest/Users/Docker_Image.html#coala-on-travis-ci this link.
However I think the problem is the first url in
[http://harelba.github.io/q/](http://harelba.github.io/q/)
not the second

because generally in markdown files we use [description](actual_url) right ?

So ideally we should do a match with second url and not first right ?

@ghost
Copy link
Author

ghost commented Jan 24, 2017

for reference go to regex101.com and use this as regex
((git\+|bzr\+|svn\+|hg\+|)https?:\/\/[^.:%\s_\/?#[\]@\\]+\.((?:[^\s()%\'"`<>|\\\[\]]+)|\([^\s()%\'"`<>|\\]*\))*)(?<!\.)(?<!,)
then use this as test string
[http://harelba.github.io/q/200](http://harelba.github.io/q/200)

This may be helpful in understanding the changes I made in my PR

gosom pushed a commit to gosom/coala-bears that referenced this issue Jul 15, 2017
Resolve matching for url of type "[valid_url](valid_url)"

Fixes coala#1338
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants