Two questions.
I wrote this in the links’ hook:
{{ if eq $destination "#" }}
{{.Text|htmlUnescape}}
{{ else if or (eq .Text "...") (eq $destination "COMMENTS")}}
<span class="inner-comments">[{{.Text}}]</span>
The exemple is
> dsfdsfds [...] [sfdsfds](COMMENTS)
[sfdsfds](COMMENTS)
(signifying a commentary inside a quotation block) processes properly, but never [...]
.
Why does eq .Text "..."
not work ? I tried adding ()
to the the [...]
and it doesn’t get recognized as anything else than a link.
without the htmlunescape every single special character comes up as its html escape code. Why ? It’s supposed to be rendered already.
1) This is not a link:
[...]
2) This is a link with an empty destination:
[...]()
3) Unless you have this in your site config…
[markup.goldmark.extensions]
typographer = false
The ...
is an ellipsis, rendered to …
1 Like
Thanks. But if I use … , what do I need to target it ?
if eq .Text "…"
doesn’t seem to do the trick. Neither does the elipsis …
character either.
Funny though, do you know why it escapes the ellipsis and not, for instance, ᅫ ? Or ‥
, the unicode character just before, and probably less common ?
I’ll just use {{ else if eq $destination "#"}}
. simple enough
Well, since ...
is rendered to …
you need to compare .Text
to… …
Tom_Durand:
it escapes the ellipsis
No, it doesn’t.
The Goldmark typographer extension replaces a predefined set of punctuation characters with an HTML entity.
https://github.com/yuin/goldmark#typographer-extension
1 Like
What exactly are you trying to achieve?
well nothing anymore, it’s fine now
I’m content of the way it works.
1 Like
system
Closed
April 13, 2023, 1:59pm
9
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.