Open elenalape opened 3 years ago
It's something I've come across before (I see I left a TODO in the source). It would require maintaining a list of these links, and resolving them to their targets. I'm not sure CommonMark's AST code gives those targets.
What do you think about using some regex to remove relative links then completely, so that no errors are thrown? I could work on that change. Also, could remove the fancy badges (#1).
I like that idea. "Explicit is better than implicit" etc.
If you want to take it on that would be great.
@normanlorrain do you have any advice on how to get the dev environment set up besides cheatsheet? I'm having issues with the fitz/PyMuPDF imports (which you must have also had to navigate!) and would appreciate some pointers.
I've updated the package. Sorry for the glitch, I missed some changes to PyMuPDF in their latest version.
If you upgrade your installation:
pip install --upgrade mdpdf
it should work now.
To support GitHub flavoured markdown (along with #1), it would be nice to allow for relative links within the document. As a temporary solution, currently I'm changing them in the md file to web URLs using regex, and then passing it to mdpdf. Using sed:
which finds bits such as
#example-relative-link)
and replaces them withhttps://example.org/dir#example-relative-link)