Skip to content

Commit

Permalink
fix: extra space in link before punctuation (#89)
Browse files Browse the repository at this point in the history
Currently - there is an extra space that renders in the blogs if there
is punctuation right after a link.

Example:
![Screenshot 2023-09-05 at 2 21 08
PM](https://github.com/mesosphere/d2iq-engineering-blog/assets/5703649/3309e48e-e091-44b1-8b27-e3dbb27bec3c)

Found at the bottom of this post:
https://eng.d2iq.com/blog/profiling-kubernetes-controllers-with-pprof/

It appears it's because we added this:

https://github.com/mesosphere/d2iq-engineering-blog/blob/main/themes/casperv5/layouts/_default/_markup/render-link.html

This is a great add, because it will automatically make sure that links
will go to a new tab/window.
However, it adds an extra space if the link is followed by punctuation
(`,` `.` etc.)
This probably wasn't found before, because the markdown will get rid of
any double/extra spaces if it's just on a normal line, followed by other
words. BUT, it looks like it adds it here because there's an extra line
that's added at the bottom of this html file.

Getting rid of the new line gets rid of this nit picky sort of thing
(from building it locally):
![Screenshot 2023-09-05 at 2 21 32
PM](https://github.com/mesosphere/d2iq-engineering-blog/assets/5703649/2df4e85d-09e0-4fc9-945c-83464468eb53)
  • Loading branch information
msdolbey authored Sep 5, 2023
1 parent 4681701 commit 723dfad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion themes/casperv5/layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>
<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>

0 comments on commit 723dfad

Please sign in to comment.