manuzhang / mkdocs-htmlproofer-plugin

A MkDocs plugin that validates URL in rendered html files
MIT License
41 stars 16 forks source link

Check attr list id anchors #51

Closed hendrikp closed 1 year ago

hendrikp commented 1 year ago

As discussed: This solves the attribute list anchor check, while still searching in the markdown (not the output html elements with ids).

Closes #42

manuzhang commented 1 year ago

thanks @hendrikp I'm also exploring checking anchors in output html files. If that works, I will submit a PR and let's see which approach is better.

hendrikp commented 1 year ago

thanks @hendrikp I'm also exploring checking anchors in output html files. If that works, I will submit a PR and let's see which approach is better.

Yes maybe, i thought about it a bit and im not sure all the html will be available at that point. (also doesn't it require then setting the validate_rendered_template always?)

Is there a way to guarantee that the html is validated only after all other plugins (e.g. https://github.com/flywire/caption have modified the html) and all pages have been generated. (Because when you'd check before that it would fail, as dependent pages might be missing still or unmodified). Also the custom caption would require i think also checking table and div tag ids (ill check and get back to you). Basically you'd have to have a option in the html proofer plugin which html tags should have their ids checked if not checking all by default.

With markdown at least one doesn't have that issue, as order as well as which html tags is not important.