chirun-ncl / chirun

A Python package providing the command line interface for building flexible and accessible content with Chirun.
https://chirun.org.uk/
Other
30 stars 4 forks source link

LaTeX URL - HTML version converts -- to – #88

Open prowlett opened 3 years ago

prowlett commented 3 years ago

This code in LaTeX:

\documentclass{article}
\usepackage{hyperref}
\begin{document}
    \href{/static/files/a--file.pdf}{View file}.
\end{document}

creates a link like

<a href="../../static/files/a–file.pdf">View file</a>. 

i.e. the -- in the filename is interpreted as , leading to a 404 error.

Note that this equivalent code in Markdown:

[View file](/static/files/a--file.pdf).

works fine, creating a link like

<a href="../../static/files/a--file.pdf">View file</a>.

Of course, I've changed the filename to only have one - as a workaround.

I've just realised this is a URL thing, rather than a static files thing. For example, this code

\documentclass{article}
\usepackage{hyperref}
\begin{document}
    \href{https://duckduckgo.com/?q=--}{Search --}.
\end{document}

creates a link like

<a href="https://duckduckgo.com/?q=–">Search –</a>. 
christianp commented 1 year ago

I think this is a bug in plasTeX - it's applying its character normalizations, but it shouldn't. I've opened an issue in the plasTeX repo: plastex/plastex#342