-
Hi, Thank you for your work on this package. And for your care when it comes to issues. I encountered an issue while rendering a url with special characters. How can I sanitize the content of the markdown files for them not to be interpreted as Tex ? Content of the markdown file:
I used I already tried this before markdown input:
Thank you in advance for your answer ! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
Hi, thanks for using the Markdown package!
They are not interpreted as TeX. Namely, the percent signs are deactivated when using the Here is the TeX output of your above example document: \markdownRendererDocumentBegin
\markdownRendererSectionBegin
\markdownRendererSectionBegin
\markdownRendererHeadingTwo{Organisation}\markdownRendererInterblockSeparator
{}L'organisation doit suivre une logique \markdownRendererLink{récursive}{https://fr.wikipedia.org/wiki/R\markdownRendererPercentSign{}C3\markdownRendererPercentSign{}A9cursivit\markdownRendererPercentSign{}C3\markdownRendererPercentSign{}A9}{https://fr.wikipedia.org/wiki/R%C3%A9cursivit%C3%A9}{}.
\markdownRendererSectionEnd
\markdownRendererSectionEnd \markdownRendererDocumentEnd You should try and redefine the command \documentclass{article}
\usepackage{markdown}
\markdownSetup {
renderers = {
link = {%
\href{#3}{#1}%
},
}
}
\usepackage{hyperref}
\begin{document}
\begin{markdown}
## Organisation
L'organisation doit suivre une logique [récursive](https://fr.wikipedia.org/wiki/R%C3%A9cursivit%C3%A9).
\end{markdown}
\end{document} However, we also seem to produce functional hyperlinks with the default renderers: \documentclass{article}
\usepackage{markdown}
\usepackage{hyperref}
\begin{document}
\begin{markdown}
## Organisation
L'organisation doit suivre une logique [récursive](https://fr.wikipedia.org/wiki/R%C3%A9cursivit%C3%A9).
\end{markdown}
\end{document} Therefore, it's unclear to me how you arrived at your result. Can you share an example TeX document that I can compile? Furthermore, what version of the Markdown package do you use? You should see a line such as |
Beta Was this translation helpful? Give feedback.
-
Thank you for your reply. So yes I was already overriding the render of the hyperlinks using this tho:
Version log: For you to compile locally:
test.tex:
test.md:
|
Beta Was this translation helpful? Give feedback.
-
Use the argument Furthermore, you should add \global\def\markdownRendererLink#1#2#3#4{%
\href{#2}{#1}%
} |
Beta Was this translation helpful? Give feedback.
-
It works perfectly fine for me ! Thank you so much for your time and attention, have a good one ! |
Beta Was this translation helpful? Give feedback.
-
Happy to help! |
Beta Was this translation helpful? Give feedback.
Use the argument
#3
instead of#2
. As you can see in #475 (comment),#2
contains the URL text for typesetting with special symbols replaced with renderer commands, whereas#3
contains the raw URL text, which is what you want here.Furthermore, you should add
%
at the end of the first two lines to get rid of the extra spaces around the hyperlink. Like this: