I’ve been noticing a strange behavior when an excerpt has links, be it to a #tag
, an attachment, anything at all.
It can be seen on the first topic here: https://forum.comparajogos.com.br/tag/gloomhaven
The excerpt
field is as follows (links redacted as ...
):
Quer ganhar um Gloomhaven <a class=\"hashtag\" href=\"...\">#gloomhaven-jaws-of-the-lion</a> com apenas 10 reais? Entre nesse grupo e participe do sorteio! <a href=\"...\" rel=\"noopener nofollow ugc\">ht…</a>
The rendered topic-excerpt
HTML is:
<a href="/t/sorteio-de-um-gloomhaven-jaws-of-the-lion/2237" class="topic-excerpt"> Quer ganhar um Gloomhaven </a><a class="hashtag" href="...">#gloomhaven-jaws-of-the-lion</a> com apenas 10 reais? Entre nesse grupo e participe do sorteio! <a href="..." rel="noopener nofollow ugc">ht…</a>
Considering <a>
's can’t be nested, this </a>
right before the excerpt’s first <a>
must be related to this change:
https://github.com/discourse/discourse/commit/84e2915e71ed576560f83d21fc055bb7c8bdb007
This causes the rest of the excerpt to be styled as part of the parent element (not .topic-excerpt
).
In my linked example the list/topic-excerpt
template is being used by the Topic List Previews plugin, but the same happens on pinned topics.