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

How to use regex in --href-ignore argument #199

Closed
cornernote opened this issue Apr 19, 2015 · 1 comment
Closed

How to use regex in --href-ignore argument #199

cornernote opened this issue Apr 19, 2015 · 1 comment

Comments

@cornernote
Copy link

I need to ignore some external links because they fail when checking from travis-ci. I started with a comma list of them, however as the list grows I would like to use regex to keep the list smaller.

I tried like the following:

htmlproof _site --href-ignore http://www.opencart.com/,https://www\.drupal\.org/.*
htmlproof _site --href-ignore "'http://www.opencart.com/','https://www\.drupal\.org/.*'"

However it still tries to check https://www.drupal.org/drupal-7.0. How can I use regex in this argument?

@cornernote
Copy link
Author

Found the answer on a stackoverflow question:

http://stackoverflow.com/questions/29678646/can%C2%B4t-get-htmlproof-to-accept-an-ignore-pattern

Basically it needs to be between forward slashes:

htmlproof _site --href-ignore http://www.opencart.com/,/https:\/\/www\.drupal\.org\/.*/

leo added a commit to leo/site that referenced this issue Jul 4, 2015
Wrapped the Regex in non-escaped forward slashes (thanks to [this][1]).

[1]: gjtorikian/html-proofer#199
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant