{"id":13632240,"url":"https://github.com/gjtorikian/html-proofer","last_synced_at":"2026-01-07T02:15:21.631Z","repository":{"id":7153210,"uuid":"8451893","full_name":"gjtorikian/html-proofer","owner":"gjtorikian","description":"Test your rendered HTML files to make sure they're accurate.","archived":false,"fork":false,"pushed_at":"2025-02-21T14:08:01.000Z","size":8829,"stargazers_count":1602,"open_issues_count":14,"forks_count":207,"subscribers_count":31,"default_branch":"main","last_synced_at":"2025-05-09T14:03:19.147Z","etag":null,"topics":["html","link-checker","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gjtorikian.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"gjtorikian","patreon":"gjtorikian","open_collective":"garen-torikian","issuehunt":"gjtorikian"}},"created_at":"2013-02-27T08:35:49.000Z","updated_at":"2025-05-04T05:19:02.000Z","dependencies_parsed_at":"2023-02-14T21:15:37.088Z","dependency_job_id":"2b33a1fb-bc19-4c66-80c2-44c7e349a840","html_url":"https://github.com/gjtorikian/html-proofer","commit_stats":{"total_commits":1429,"total_committers":91,"mean_commits":"15.703296703296703","dds":0.6088173547935619,"last_synced_commit":"4cc3f62e395068e55bdafbabca7de0a0b5e57610"},"previous_names":[],"tags_count":167,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjtorikian%2Fhtml-proofer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjtorikian%2Fhtml-proofer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjtorikian%2Fhtml-proofer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjtorikian%2Fhtml-proofer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gjtorikian","download_url":"https://codeload.github.com/gjtorikian/html-proofer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254544142,"owners_count":22088807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","link-checker","ruby"],"created_at":"2024-08-01T22:02:57.262Z","updated_at":"2026-01-07T02:15:21.625Z","avatar_url":"https://github.com/gjtorikian.png","language":"Ruby","readme":"# HTMLProofer\n\nIf you generate HTML files, _then this tool might be for you_!\n\n## Project scope\n\nHTMLProofer is a set of tests to validate your HTML output. These tests check if your image references are legitimate, if they have alt tags, if your internal links are working, and so on. It's intended to be an all-in-one checker for your output.\n\nIn scope for this project is any well-known and widely-used test for HTML document quality. A major use for this project is continuous integration -- so we must have reliable results. We usually balance correctness over performance. And, if necessary, we should be able to trace this program's detection of HTML errors back to documented best practices or standards, such as W3 specifications.\n\n**Third-party modules.** We want this product to be useful for continuous integration so we prefer to avoid subjective tests which are prone to false positive results, such as spell checkers, indentation checkers, etc. If you want to work on these items, please see [the section on custom tests](#custom-tests) and consider adding an implementation as a third-party module.\n\n**Advanced configuration.** Most front-end developers can test their HTML using [our command line program](#using-on-the-command-line). Advanced configuration will require using Ruby.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'html-proofer'\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install html-proofer\n\n**NOTE:** When installation speed matters, set `NOKOGIRI_USE_SYSTEM_LIBRARIES` to `true` in your environment. This is useful for increasing the speed of your Continuous Integration builds.\n\n## What's tested?\n\nBelow is a mostly comprehensive list of checks that HTMLProofer can perform.\n\n### Images\n\n`img` elements:\n\n- Whether all your images have alt tags\n- Whether your internal image references are not broken\n- Whether external images are showing\n- Whether your images are HTTP\n\n### Links\n\n`a`, `link` elements:\n\n- Whether your internal links are working\n- Whether your internal hash references (`#linkToMe`) are working\n- Whether external links are working\n- Whether your links are HTTPS\n- Whether CORS/SRI is enabled\n\n### Scripts\n\n`script` elements:\n\n- Whether your internal script references are working\n- Whether external scripts are loading\n- Whether CORS/SRI is enabled\n\n### Favicon\n\n- Whether your favicons are valid.\n\n### OpenGraph\n\n- Whether the images and URLs in the OpenGraph metadata are valid.\n\n## Usage\n\nYou can configure HTMLProofer to run on:\n\n- a file\n- a directory\n- an array of directories\n- an array of links\n\nIt can also run through the command-line.\n\n### Checking a single file\n\nIf you simply want to check a single file, use the `check_file` method:\n\n```ruby\nHTMLProofer.check_file(\"/path/to/a/file.html\").run\n```\n\n### Checking directories\n\nIf you want to check a directory, use `check_directory`:\n\n```ruby\nHTMLProofer.check_directory(\"./out\").run\n```\n\nIf you want to check multiple directories, use `check_directories`:\n\n```ruby\nHTMLProofer.check_directories([\"./one\", \"./two\"]).run\n```\n\n### Checking an array of links\n\nWith `check_links`, you can also pass in an array of links:\n\n```ruby\nHTMLProofer.check_links([\"https://github.com\", \"https://jekyllrb.com\"]).run\n```\n\n### Swapping information\n\nSometimes, the information in your HTML is not the same as how your server serves content. In these cases, you can use `swap_urls` to map the URL in a file to the URL you'd like it to become. For example:\n\n```ruby\nrun_proofer(file, :file, swap_urls: { %r{^https//placeholder.com} =\u003e \"https://website.com\" })\n```\n\nIn this case, any link that matches the `^https://placeholder.com` will be converted to `https://website.com`.\n\nA similar swapping process can be done for attributes:\n\n```ruby\nrun_proofer(file, :file, swap_attributes: { \"img\"  =\u003e [[\"data-src\", \"src\"]] })\n```\n\nIn this case, we are telling HTMLProofer that, for any `img` tag detected, for any `src` attribute, pretend it's actually the `src` attribute instead. Since the value is an array of arrays, you can pass in as many attribute swaps as you need for each element.\n\n### Using on the command-line\n\nYou'll also get a new program called `htmlproofer` with this gem. Terrific!\n\nPass in options through the command-line as flags, like this:\n\n```bash\nhtmlproofer --extensions .html.erb ./out\n```\n\nUse `htmlproofer --help` to see all command line options.\n\n#### Special cases for the command-line\n\nFor options which require an array of input, surround the value with quotes, and don't use\nany spaces. For example, to exclude an array of HTTP status code, you might do:\n\n```bash\nhtmlproofer --ignore-status-codes \"999,401,404\" ./out\n```\n\nFor something like `url-ignore`, and other options that require an array of regular expressions,\nyou can pass in a syntax like this:\n\n```bash\nhtmlproofer --ignore-urls \"/www.github.com/,/foo.com/\" ./out\n```\n\nSince `swap_urls` is a bit special, you'll pass in a pair of `RegEx:String`\nvalues. The escape sequences `\\:` should be used to produce literal\n`:`s `htmlproofer` will figure out what you mean.\n\n```bash\nhtmlproofer --swap-urls \"wow:cow,mow:doh\" --extensions .html.erb --ignore-urls www.github.com ./out\n```\n\nSome configuration options, such as `--typheous`, `--cache`, or `--swap-attributes`, require well-formatted JSON.\n\n#### Adjusting for a `baseurl`\n\nIf your Jekyll site has a `baseurl` configured, you'll need to adjust the\ngenerated url validation to cope with that. The easiest way is using the\n`swap_urls` option.\n\nFor a `site.baseurl` value of `/BASEURL`, here's what that looks like on the\ncommand line:\n\n```bash\nhtmlproofer --assume-extension ./_site --swap-urls '^/BASEURL/:/'\n```\n\nor in your `Rakefile`\n\n```ruby\nrequire \"html-proofer\"\n\ntask :test do\n  sh \"bundle exec jekyll build\"\n  options = { swap_urls: \"^/BASEURL/:/\" }\n  HTMLProofer.check_directory(\"./_site\", options).run\nend\n```\n\n### Using through Docker\n\nIf you have trouble with (or don't want to) install Ruby/Nokogumbo, the command-line tool can be run through Docker. See [klakegg/html-proofer](https://hub.docker.com/r/klakegg/html-proofer) for more information.\n\n## Ignoring content\n\nAdd the `data-proofer-ignore` attribute to any tag to ignore it from every check.\n\n```html\n\u003ca href=\"https://notareallink\" data-proofer-ignore\u003eNot checked.\u003c/a\u003e\n```\n\nThis can also apply to parent elements, all the way up to the `\u003chtml\u003e` tag:\n\n```html\n\u003cdiv data-proofer-ignore\u003e\n  \u003ca href=\"https://notareallink\"\u003eNot checked because of parent.\u003c/a\u003e\n\u003c/div\u003e\n```\n\n## Ignoring new files\n\nSay you've got some new files in a pull request, and your tests are failing because links to those files are not live yet. One thing you can do is run a diff against your base branch and explicitly ignore the new files, like this:\n\n```ruby\ndirectories = ['content']\nmerge_base = %x(git merge-base origin/production HEAD).chomp\ndiffable_files = %x(git diff -z --name-only --diff-filter=AC #{merge_base}).split(\"\\0\")\ndiffable_files = diffable_files.select do |filename|\n  next true if directories.include?(File.dirname(filename))\n\n  filename.end_with?(\".md\")\nend.map { |f| Regexp.new(File.basename(f, File.extname(f))) }\n\nHTMLProofer.check_directory(\"./output\", { ignore_urls: diffable_files }).run\n```\n\n## Configuration\n\nThe `HTMLProofer` constructor takes an optional hash of additional options:\n\n| Option                  | Description                                                                                                                                         | Default                          |\n| :---------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------- |\n| `allow_hash_href`       | If `true`, assumes `href=\"#\"` anchors are valid                                                                                                     | `true`                           |\n| `allow_missing_href`    | If `true`, does not flag `a` tags missing `href`. In HTML5, this is technically allowed, but could also be human error.                             | `false`                          |\n| `assume_extension`      | Automatically add specified extension to files for internal links, to allow extensionless URLs (as supported by most servers)                       | `.html`                          |\n| `checks`                | An array of Strings indicating which checks you want to run                                                                                         | `['Links', 'Images', 'Scripts']` |\n| `check_external_hash`   | Checks whether external hashes exist (even if the webpage exists)                                                                                   | `true`                           |\n| `check_internal_hash`   | Checks whether internal hashes exist (even if the webpage exists)                                                                                   | `true`                           |\n| `check_sri`             | Check that `\u003clink\u003e` and `\u003cscript\u003e` external resources use SRI                                                                                       | false                            |\n| `directory_index_file`  | Sets the file to look for when a link refers to a directory. (Overrules `directory_index_files` if present.)                                        | `index.html`                     |\n| `directory_index_files` | Sets the files to look for when a link refers to a directory.                                                                                       | `['index.html']`                 |\n| `disable_external`      | If `true`, does not run the external link checker                                                                                                   | `false`                          |\n| `enforce_https`         | Fails a link if it's not marked as `https`.                                                                                                         | `true`                           |\n| `extensions`            | An array of Strings indicating the file extensions you would like to check (including the dot)                                                      | `['.html']`                      |\n| `ignore_empty_alt`      | If `true`, ignores images with empty/missing alt tags (in other words, `\u003cimg alt\u003e` and `\u003cimg alt=\"\"\u003e` are valid; set this to `false` to flag those) | `true`                           |\n| `ignore_files`          | An array of Strings or RegExps containing file paths that are safe to ignore.                                                                       | `[]`                             |\n| `ignore_empty_mailto`   | If `true`, allows `mailto:` `href`s which do not contain an email address.                                                                          | `false`                          |\n| `ignore_missing_alt`    | If `true`, ignores images with missing alt tags                                                                                                     | `false`                          |\n| `ignore_status_codes`   | An array of numbers representing status codes to ignore.                                                                                            | `[]`                             |\n| `ignore_urls`           | An array of Strings or RegExps containing URLs that are safe to ignore. This affects all HTML attributes, such as `alt` tags on images.             | `[]`                             |\n| `log_level`             | Sets the logging level, as determined by [Yell](https://github.com/rudionrails/yell). One of `:debug`, `:info`, `:warn`, `:error`, or `:fatal`.     | `:info`                          |\n| `only_4xx`              | Only reports errors for links that fall within the 4xx status code range.                                                                           | `false`                          |\n| `root_dir`              | The absolute path to the directory serving your html-files.                                                                                         | \"\"                               |\n| `swap_attributes`       | JSON-formatted config that maps element names to the preferred attribute to check                                                                   | `{}`                             |\n| `swap_urls`             | A hash containing key-value pairs of `RegExp =\u003e String`. It transforms URLs that match `RegExp` into `String` via `gsub`.                           | `{}`                             |\n\nIn addition, there are a few \"namespaced\" options. These are:\n\n- `:typhoeus` / `:hydra`\n- `:cache`\n\n### Configuring Typhoeus and Hydra\n\n[Typhoeus](https://github.com/typhoeus/typhoeus) is used to make fast, parallel requests to external URLs. You can pass in any of Typhoeus' options for the external link checks with the options namespace of `:typhoeus`. For example:\n\n```ruby\nHTMLProofer.new(\"out/\", { extensions: [\".htm\"], typhoeus: { verbose: true, ssl_verifyhost: 2 } })\n```\n\nThis sets `HTMLProofer`'s extensions to use _.htm_, gives Typhoeus a configuration for it to be verbose, and use specific SSL settings. Check the [Typhoeus documentation](https://github.com/typhoeus/typhoeus#other-curl-options) for more information on what options it can receive.\n\nYou can similarly pass in a `:hydra` option with a hash configuration for Hydra.\n\nThe default value is:\n\n```ruby\n{\n  typhoeus:\n  {\n    followlocation: true,\n    connecttimeout: 10,\n    timeout: 30,\n  },\n  hydra: { max_concurrency: 50 },\n}\n```\n\nOn the CLI, you can provide the `--typhoeus` or `--hydra` arguments to set the configurations. This is parsed using `JSON.parse` and mapped on top of the default configuration values so that they can be overridden. To pass in the above example on the CLI, you would do:\n\n```bash\nhtmlproofer --typhoeus '{ \"followlocation\": true, \"connecttimeout\": 10, \"timeout\": 30 }' --hydra '{ \"max_concurrency\": 50 }'\n```\n\n#### Setting `before-request` callback\n\nYou can provide a block to set some logic before an external link is checked. For example, say you want to provide an authentication token every time a GitHub URL is checked. You can do that like this:\n\n```ruby\nproofer = HTMLProofer.check_directory(item, opts)\nproofer.before_request do |request|\n  request.options[:headers][\"Authorization\"] = \"Bearer \u003cTOKEN\u003e\" if request.base_url == \"https://github.com\"\nend\nproofer.run\n```\n\nThe `Authorization` header is being set if and only if the `base_url` is `https://github.com`, and it is excluded for all other URLs.\n\n## Configuring caching\n\nChecking external URLs can slow your tests down. If you'd like to speed that up, you can enable caching for your external and internal links. Caching simply means to skip link checking for links that are valid for a certain period of time.\n\nYou can enable caching for this by passing in the configuration option `:cache`, with a hash containing a single key, `:timeframe`. `:timeframe` defines the length of time the cache will be used before the link is checked again. The format of `:timeframe` is a hash containing two keys, `external` and `internal`. Each of these contains a number followed by a letter indicating the length of time:\n\n- `M` means months\n- `w` means weeks\n- `d` means days\n- `h` means hours\n\nFor example, passing the following options means \"recheck external links older than thirty days\":\n\n```ruby\n{ cache: { timeframe: { external: \"30d\" } } }\n```\n\nAnd the following options means \"recheck internal links older than two weeks\":\n\n```ruby\n{ cache: { timeframe: { internal: \"2w\" } } }\n```\n\nNaturally, to support both internal and external link caching, both keys would need to be provided. The following checks external links every two weeks, but internal links only once a week:\n\n```ruby\n{ cache: { timeframe: { external: \"2w\", internal: \"1w\" } } }\n```\n\nYou can change the filename or the directory where the cache file is kept by also providing the `storage_dir` key:\n\n```ruby\n{ cache: { cache_file: \"stay_cachey.json\", storage_dir: \"/tmp/html-proofer-cache-money\" } }\n```\n\nLinks that were failures are kept in the cache and _always_ rechecked. If they pass, the cache is updated to note the new timestamp.\n\nThe cache operates on external links only.\n\nIf caching is enabled, HTMLProofer writes to a log file called _tmp/.htmlproofer/cache.log_. You should probably ignore this folder in your version control system.\n\nOn the CLI, you can provide the `--cache` argument to set the configuration. This is parsed using\n`JSON.parse` and mapped on top of the default configuration values so that they can be overridden.\nTo pass in one of the above examples on the CLI, you would do:\n\n```bash\nhtmlproofer --cache '{ \"timeframe\": { \"external\": \"2w\", \"internal\": \"1w\" } }'\n```\n\n### Caching with continuous integration\n\nAfter configuring HTMLProofer to cache its results (see the above section), you can enable caching\nin your continuous integration process to make your builds faster as well as avoiding rate limits\non the external sites you might be linking to.\n\n**In GitHub Actions:**\n\nAdd this step to your build workflow before HTMLProofer is run:\n\n```yaml\n- name: Cache HTMLProofer\n  id: cache-htmlproofer\n  uses: actions/cache@v2\n  with:\n    path: tmp/.htmlproofer\n    key: ${{ runner.os }}-htmlproofer\n```\n\nAlso make sure that your later step which runs HTMLProofer will not return a failed shell status. You can try something like `html-proof ... || true`. Because a failed step in GitHub Actions will skip all later steps.\n\n**In Travis:**\n\nIf you want to enable caching with Travis CI, be sure to add these lines into your _.travis.yml_ file:\n\n```yaml\ncache:\n  directories:\n    - $TRAVIS_BUILD_DIR/tmp/.htmlproofer\n```\n\nFor more information on using HTML-Proofer with Travis CI, see [this wiki page](https://github.com/gjtorikian/html-proofer/wiki/Using-HTMLProofer-From-Ruby-and-Travis).\n\n## Logging\n\nHTML-Proofer can be as noisy or as quiet as you'd like. If you set the `:log_level` option, you can better define the level of logging.\n\n## Custom tests\n\nWant to write your own test? Sure, that's possible!\n\nJust create a class that inherits from `HTMLProofer::Check`. This subclass must define one method called `run`. This is called on your content, and is responsible for performing the validation on whatever elements you like. When you catch a broken issue, call `add_failure(message, line: line, content: content)` to explain the error. `line` refers to the line numbers, and `content` is the node content of the broken element.\n\nIf you're working with the element's attributes (as most checks do), you'll also want to call `create_element(node)` as part of your suite. This constructs an object that contains all the attributes of the HTML element you're iterating on, and can also be used directly to call `add_failure(message, element: element)`.\n\nHere's an example custom test demonstrating these concepts. It reports `mailto` links that point to `octocat@github.com`:\n\n```ruby\nclass MailToOctocat \u003c HTMLProofer::Check\n  def mailto_octocat?\n    @link.url.raw_attribute == \"mailto:octocat@github.com\"\n  end\n\n  def run\n    @html.css(\"a\").each do |node|\n      @link = create_element(node)\n\n      next if @link.ignore?\n\n      return add_failure(\"Don't email the Octocat directly!\", element: @link) if mailto_octocat?\n    end\n  end\nend\n```\n\nDon't forget to include this new check in HTMLProofer's options, for example:\n\n```ruby\n# removes default checks and just runs this one\nHTMLProofer.check_directories([\"out/\"], { checks: [\"MailToOctocat\"] })\n```\n\nSee our [list of third-party custom classes](\u003chttps://github.com/gjtorikian/html-proofer/wiki/Extensions-(custom-classes)\u003e) and add your own to this list.\n\n## Reporting\n\nBy default, HTML-Proofer has its own reporting mechanism to print errors at the end of the run. You can choose to use your own reporter by passing in your own subclass of `HTMLProofer::Reporter`:\n\n```ruby\nproofer = HTMLProofer.check_directory(item, opts)\nproofer.reporter = MyCustomReporter.new(logger: proofer.logger)\nproofer.run\n```\n\nYour custom reporter must implement the `report` function which implements the behavior you wish to see. The `logger` kwarg is optional.\n\n## Accessing Failures Programmatically\n\nAfter running HTMLProofer, you can access the list of failures through the `failed_checks` method. Each failure is an `HTMLProofer::Failure` object containing detailed information about the error:\n\n```ruby\nproofer = HTMLProofer.check_directory(\"./out\")\nproofer.run\n\nproofer.failed_checks.each do |failure|\n  puts \"File: #{failure.path}\"\n  puts \"Check: #{failure.check_name}\"\n  puts \"Description: #{failure.description}\"\n  puts \"Line: #{failure.line}\"\n  puts \"Status: #{failure.status}\" # HTTP status code for external links\n  puts \"Content: #{failure.content}\" # Text content of the element\nend\n```\n\n### Accessing the Element\n\nEach failure also provides access to the original `HTMLProofer::Element` object, which gives you access to the underlying Nokogiri node and all its attributes:\n\n```ruby\nproofer.failed_checks.each do |failure|\n  element = failure.element\n  next if element.nil?\n\n  # Access the Nokogiri node directly\n  node = element.node\n  puts \"Tag name: #{node.name}\"\n  puts \"Href: #{node['href']}\"\n  puts \"All attributes: #{node.attributes.keys}\"\n\n  # Use helper methods\n  puts \"Is anchor tag: #{element.a_tag?}\"\n  puts \"Is image tag: #{element.img_tag?}\"\n  puts \"Link text: #{element.content}\"\n  puts \"Line number: #{element.line}\"\nend\n```\n\nThis is useful for building custom reporters, integrating with other tools, or programmatically processing validation results.\n\n## Troubleshooting\n\nHere are some brief snippets identifying some common problems that you can work around. For more information, check out [our wiki](https://github.com/gjtorikian/html-proofer/wiki).\n\n[Our wiki page](https://github.com/gjtorikian/html-proofer/wiki/Using-HTMLProofer-From-Ruby-and-Travis) on using HTML-Proofer with Travis CI might also be useful.\n\n### Ignoring SSL certificates\n\nTo ignore SSL certificates, turn off Typhoeus' SSL verification:\n\n```ruby\nHTMLProofer.check_directory(\"out/\", {\n  typhoeus: {\n    ssl_verifypeer: false,\n    ssl_verifyhost: 0,\n},\n}).run\n```\n\n### User-Agent\n\nTo change the User-Agent used by Typhoeus:\n\n```ruby\nHTMLProofer.check_directory(\"out/\", {\n  typhoeus: {\n    headers: { \"User-Agent\" =\u003e \"Mozilla/5.0 (compatible; My New User-Agent)\" },\n  }\n}).run\n```\n\nAlternatively, you can specify these options on the command-line with:\n\n```bash\nhtmlproofer --typhoeus='{\"headers\":{\"User-Agent\":\"Mozilla/5.0 (compatible; My New User-Agent)\"}}'\n```\n\n### Cookies\n\nSometimes links fail because they don't have access to cookies. To fix this you can create a .cookies file using the following snippets:\n\n```ruby\nHTMLProofer.check_directory(\"out/\", {\n  typhoeus: {\n    cookiefile: \".cookies\",\n    cookiejar: \".cookies\",\n  }\n}).run\n```\n\n```bash\nhtmlproofer --typhoeus='{\"cookiefile\":\".cookies\",\"cookiejar\":\".cookies\"}'\n```\n\n### Regular expressions\n\nTo exclude urls using regular expressions, include them between forward slashes and don't quote them:\n\n```ruby\nHTMLProofer.check_directories([\"out/\"], {\n  ignore_urls: [/example.com/],\n}).run\n```\n\n## Real-life examples\n\n| Project                                                                    | Repository                                                                      | Notes                                                                                                                                                                                                                                     |\n| :------------------------------------------------------------------------- | :------------------------------------------------------------------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [Jekyll's website](https://jekyllrb.com/)                                  | [jekyll/jekyll](https://github.com/jekyll/jekyll)                               | A [separate script](https://github.com/jekyll/jekyll/blob/master/script/proof) calls `htmlproofer` and this used to be [called from Circle CI](https://github.com/jekyll/jekyll/blob/fdc0e33ebc9e4861840e66374956c47c8f5fcd95/circle.yml) |\n| [Raspberry Pi's documentation](https://www.raspberrypi.org/documentation/) | [raspberrypi/documentation](https://github.com/raspberrypi/documentation)       |\n| [Squeak's website](https://squeak.org)                                     | [squeak-smalltalk/squeak.org](https://github.com/squeak-smalltalk/squeak.org)   |\n| [Atom Flight Manual](https://flight-manual.atom.io)                        | [atom/flight-manual.atom.io](https://github.com/atom/flight-manual.atom.io)     |\n| [GitHub does dotfiles](https://dotfiles.github.io/)                        | [dotfiles/dotfiles.github.com](https://github.com/dotfiles/dotfiles.github.com) | Uses the [proof-html](https://github.com/marketplace/actions/proof-html) GitHub action                                                                                                                                                    |\n","funding_links":["https://github.com/sponsors/gjtorikian","https://patreon.com/gjtorikian","https://opencollective.com/garen-torikian","https://issuehunt.io/r/gjtorikian"],"categories":["Ruby","Tools \u0026 Extensions","Tools \u0026 Services","Tools and Plugins"],"sub_categories":["Individual Episodes"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjtorikian%2Fhtml-proofer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgjtorikian%2Fhtml-proofer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjtorikian%2Fhtml-proofer/lists"}