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

Escape title in footer link #2735

Closed
Baltazardoung opened this issue Jun 7, 2021 · 3 comments · Fixed by #2746
Closed

Escape title in footer link #2735

Baltazardoung opened this issue Jun 7, 2021 · 3 comments · Fixed by #2746
Labels
bug Issue reports a bug

Comments

@Baltazardoung
Copy link
Contributor

0dd4831 introduced a regression within the code check via html-Proofer for a document with double quotes in the title.

Attribute set `<a href="quality_profiles_XXX_php.html" class="md-footer__link md-footer__link--next" aria-label="Suivant: Les " quality="" profiles"="" XXX"="" rel="next">
          <div class="md-footer__title">
            <div class="md-ellipsis">
              <span class="md-footer__direction">
                Suivant
              </span>
              Les "Quality Profiles" XXX
            </div>
          </div>
          <div class="md-footer__button md-icon">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"></path></svg>
          </div>
        </a>` contains an error!
/usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/element.rb:19:in `attr_reader': invalid attribute name `profiles"' (NameError)
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/element.rb:19:in `block in initialize'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/element.rb:17:in `each_pair'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/element.rb:17:in `initialize'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/check.rb:22:in `new'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/check.rb:22:in `create_element'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/check/links.rb:18:in `block in run'
	from /usr/local/bundle/gems/nokogiri-1.11.3-x86_64-linux/lib/nokogiri/xml/node_set.rb:239:in `block in each'
	from /usr/local/bundle/gems/nokogiri-1.11.3-x86_64-linux/lib/nokogiri/xml/node_set.rb:238:in `upto'
	from /usr/local/bundle/gems/nokogiri-1.11.3-x86_64-linux/lib/nokogiri/xml/node_set.rb:238:in `each'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/check/links.rb:17:in `run'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/runner.rb:113:in `block (2 levels) in check_parsed'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/runner.rb:110:in `each'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/runner.rb:110:in `block in check_parsed'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/runner.rb:109:in `each'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/runner.rb:109:in `check_parsed'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/runner.rb:137:in `check_path'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/runner.rb:98:in `block in process_files'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/runner.rb:98:in `map'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/runner.rb:98:in `process_files'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/runner.rb:76:in `check_files'
	from /usr/local/bundle/gems/html-proofer-3.19.1/lib/html-proofer/runner.rb:48:in `run'
	from /usr/local/bundle/gems/html-proofer-3.19.1/bin/htmlproofer:111:in `block (2 levels) in <top (required)>'
	from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
	from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
	from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
	from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
	from /usr/local/bundle/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	from /usr/local/bundle/gems/html-proofer-3.19.1/bin/htmlproofer:11:in `<top (required)>'
	from /usr/local/bundle/bin/htmlproofer:23:in `load'
	from /usr/local/bundle/bin/htmlproofer:23:in `<main>'
htmlproofer 3.19.1 | Error:  invalid attribute name `profiles"'
@squidfunk
Copy link
Owner

Thanks for reporting. Possibly fixed by applying the ... | e Jinja filter for escaping.

@squidfunk squidfunk added the bug Issue reports a bug label Jun 7, 2021
@Baltazardoung
Copy link
Contributor Author

Thank you for this confirmation. In our processes and CI, we automatically use the latest version of the docker mkdocs-material image.

So we are looking forward to the fix in your repository 😄.

@squidfunk
Copy link
Owner

Workaround until I find the time to provide a fix: pin version to 7.1.6.

This was referenced Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants