lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
199 stars 98 forks source link

extra space after link #127

Closed rawwerks closed 12 months ago

rawwerks commented 12 months ago

i am noticing an extra space after links, when the next character after the link is a punctuation mark. while the live demo site doesn't look like this, i built the demo site locally and was able to reproduce the issue (from https://github.com/lukeorth/poison-demo-site/commit/10c600e406bb75e9b37d45ff345624ecbcd26617 and https://github.com/lukeorth/poison/commit/f2e68b8de70a166b1822127e856726ed2b680fb2 with hugo v0.117.0). it appears that in the html there is a line break happening after every </a>. i haven't been able to figure out where in the code this is coming from.

screenshot of the issue, see space after "Remark42"

image

here is the HTML showing line breaks after every </a>:

<p>Facilitate discourse by allowing users to comment on your posts.  <em>Poison</em> currently supports two different commenting engines for this purpose &ndash; <a href="[https://disqus.com/](view-source:https://disqus.com/)" target="_blank">Disqus</a>
 and <a href="[https://remark42.com/](view-source:https://remark42.com/)" target="_blank">Remark42</a>
.</p>
tkgalk commented 12 months ago

I'm having the same issue, clean hugo with poison.

lukeorth commented 12 months ago

Hi @rawwerks -- thank you for reporting this. I am looking into it. :+1:

lukeorth commented 12 months ago

Fixed!

In case anyone is interested, my render-link.html render hook was the culprit. I have it setup to automatically add a title and target="_blank" to link elements. Apparently some text editors (including mine) are configured to add a newline char to EOF on save; a quirk I probably wouldn't have realized without the help of the fine folks in the Hugo forums.

Thanks again for alerting me to this.