我注意到,当摘要中包含链接时(无论是到 #tag、附件还是任何其他内容),会出现一种奇怪的行为。
这一点可以在这里的第一篇主题中看到:https://forum.comparajogos.com.br/tag/gloomhaven
excerpt 字段如下(链接已省略为 ...):
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>
渲染后的 topic-excerpt HTML 如下:
<a href=\"/t/sorteio-de-um-gloomhaven-jaws-of-the-lion/2237\" class=\"topic-excerpt\">\n 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>
考虑到 <a> 标签不能嵌套,出现在摘要第一个 <a> 标签之前的这个 </a> 必然与以下更改有关:
这导致摘要的其余部分被样式化为父元素的一部分(而不是 .topic-excerpt)。
在我提供的示例中,list/topic-excerpt 模板正被 Topic List Previews 插件使用,但在置顶主题中也会出现同样的问题。