Skip to content

Code span in hyperref URL #493

Closed Answered by l0th3r
l0th3r asked this question in Q&A
Sep 5, 2024 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

Based on @Witiko 's answers.

The issue is to style the à code span when it's part of a hyperref URL.

Markdown source:

[link `also link`]([google.com](https://github.com/Witiko/markdown))

Origin

Origin render:

Not the default render of link or code span

Origin Tex:

% override hyperlinks to render inline
\global\def\markdownRendererLink#1#2#3#4{%
  \href{#3}{#1}%
}

% override markdown render of inline code
\global\def\markdownRendererCodeSpan#1{%
	\codeinline{#1}
}

Fix

To be able to style a code span depending on if it's a link or not, we need to save if a markdownRendererLink is being rendered with the help of a variable. Then when rendering a code span with markdownRendererCodeSpan, …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@l0th3r
Comment options

@Witiko
Comment options

@l0th3r
Comment options

@Witiko
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by l0th3r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants