mkdocs-htmlproofer-plugin
mkdocs-htmlproofer-plugin copied to clipboard
fails on `../file.md#anchors`
Describe the bug fails on anchors such as:
Please see the [project license](../about.md#license) for further details.
../about.md will pass, but adding the #license causes it to fail
Environment (please complete the following information): Mkdocs 1.6.1 mkdocs-material 9.5.34
htmlproofer vers 1.3.0
Upd8. This if also relevant for external links that have anchors
@nahuhh Do you see this issue in previous versions?
@nahuhh Do you see this issue in previous versions?
I haven't tried previous versions. I'll test
Works on <=1.2.0 fails on >=1.2.1
@nahuhh Do you have a minimal example?
I am having a similar issue here. I am using mkdocstrings to generate autodocumentation of the whole repository in a recursive manner. The problem in my case seems to be on cross-references. If I cite a function (::: my_package.function) and this function receives input arguments that are, at the same time, in another file, it will break despite links are always fine.
In this case, _factory.md (generated in a recursive manner) contains a reference to MyData in some signatures. MKDodcstrings creates a crossed reference to MyData and it works well. However, htmlproofer reports all these kind of links as error:
WARNING:mkdocs.utils:htmlproofer: Unable to locate source file for: ../../data/my_data/#my_project.data.my_data.MyData
WARNING:mkdocs.utils:htmlproofer: invalid url - ../../data/_my_data/#my_project.data._my_data.MyData[404] [files\autodoc\_demo_datasets\_factory.md]
All warnings have the same pattern in common: they also reference anchors.
One important thing is that before, htmlproofer did not report anything before. I think it started happening after some packages were updated.
I will try to get a minimal example
I have observe the same problem with
- Mkdocs 1.6.1
- mkdocs-material 9.5.15
- htmlproofer vers 1.3.0 (same with 1.4.0)
Broken link
Please see the [project license](../about.md#license) for further details.
pointing to a Markdown file with inline html (in a table)
<td rowspan="9"><a name="license"></a>foo bar</td>
I also tried different html anchors/tags/divs without luck
<td rowspan="9"><a href="license"></a>foo bar</td>
<td rowspan="9"><div id="license">foo bar</div></td>
Also is to be noted that the link does work when I build the website and test it locally or deploy it.
@matlupi Thank for reporting. I will take a look later tonight.
@matlupi <td rowspan="9"><a id="license"></a>foo bar</td> works for me. Could you please check?
@nahuhh Do you have a minimal example?
you should be able to build https://github.com/monero-project/monero-docs to reproduce. You'll have to manually install htmlproofer
@nahuhh Do you have a minimal example?
you should be able to build https://github.com/monero-project/monero-docs to reproduce. You'll have to manually install htmlproofer
@matlupi 's minimal exammple here seems to be the same