[Bug] .github/mkdocs_hook.py will never work correctly
Search before asking
- [x] I searched the issues and found no similar issues.
Component
Makefiles and CI/CD
What happened + What you expected to happen
I see that .github/mkdocs_hook.py tries to change markdown URL links in some way, i.e., starting around line 63. However, try/except was apparently added recently because the regex will always fail if markdown content like [**hello**] is present in the text for the link. Characters like * are interpreted by the regex parser instead of passed through. This means that URL replacement is not reliable and will often fail. So, this hook either needs to be fixed to be significantly more robust or removed. Why are URLs being changed here anyway? This is not necessary with use of the proper conventions for GitHub Pages URLs, for example.
Oh, and the pattern definition is wrong for Python 3.13 on line 60:
pattern = r"\[" + text + r"\]\(" + old_link + "\)"
should be
pattern = r"\[" + text + r"\]\(" + old_link + r"\)"
Reproduction script
N/A
Anything else
No response
OS
MacOS
Python
3.11
Are you willing to submit a PR?
- [ ] Yes I am willing to submit a PR!
Hi, @shivdeep-singh-ibm. Can you please look at this? Apart from the bug that @deanwampler is reporting in line 60, are there other changes to be made in this file to make it more "robust"?