Internal/external link in footnotes css mix-up

What I’m trying to do

I have defined (through the Style Settings plugin) different text colours for internal and external links. In the screenshot the word ‘begripsonderzoek’ has the intended colour for an internal link, orange, but the inline footnote gets the external link colour, blue, which is unwanted. This happens with all footnotes. Then inside the footnote the internal link to ‘Aristotle 1995’ also gets the wrong colour (external, not internal), while after its closing ]] the footnote text continues in body text colour, neither orange nor blue.

What I want is to see the entire footnote in internal link colour, orange, including the link to Aristotle. It would be even better to have a special colour for the inline footnotes, with the internal link inside the footnote remaining orange.

Things I have tried

I tried to make sense of the source code, but failed. Help is appreciated!

Inline footnotes need a space before the ^. Notice how^[this looks in the editor] versus how ^[this looks in the editor].
See → Backlink in inline footnote not being displayed properly in live preview mode - #4 by Craftidore Seems a bug, and it’s been around for a while.

IF there is a space, your internal [[Aristotle 1995]] should show the color you picked in Style Settings. This css should be sufficient for changing the footnote color, but leaving your custom internal link color unchanged, if you still want to. (Tested with the default and Minimal themes, custom internal link color via Style Settings in Minimal.)

.cm-inline-footnote {
  color: rgba(var(--color-green-rgb), 0.75);
}

Thanks a lot, the css for footnotes is just right!

The space needed before the ^[ is a pity, especially since it is retained (as an extra space) in read view, and in pandoc PDF output as well… I will report it as a bug.

image

1 Like

Slightly amended the CSS to include the closing ] and to provide a light/dark variant.

.theme-dark .cm-inline-footnote, .theme-dark .cm-inline-footnote-end {
  color: rgba(var(--color-green-rgb), 0.4);
}

.theme-light .cm-inline-footnote, .theme-light .cm-inline-footnote-end {
  color: rgba(var(--color-green-rgb), 1.0);
}

Hmmm… I see that in edit mode it differs, but in reading view it doesn’t seem to differ whether you’ve got that space or not. I’ve not tested various color on internal vs external links, though.

Another thing you might want to consider is to use the other variant of footnotes:

... in kwestie denkt.[^1]
...
[^1]: In de Engelse...

Which has another appearance in edit mode, but does also allow for the space to be removed. All four cases displayed using Minimal theme in source mode:

And reading view:
image

It kind of suggest that the reference footnotes doesn’t need/want the space, whilst the inline footnote does want/need it.

Thanks, @holroy. I do see a space before the footnote marker in both reading view and PDF output. Also, I strongly prefer the inline syntax over the alternative.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.