# 使用标签图标时，标签描述中的链接未被转义

**URL:** <https://meta.discourse.org/t/links-in-tag-descriptions-aren-t-escaped-when-using-tag-icons/285942>\
**Category:** Bug\
**Tags:** tag-icons\
**Created:** [2023年十一月18日 16:58 UTC](https://meta.discourse.org/t/links-in-tag-descriptions-aren-t-escaped-when-using-tag-icons/285942 "2023-11-18T16:58:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年十一月18日 16:58 UTC](https://meta.discourse.org/t/links-in-tag-descriptions-aren-t-escaped-when-using-tag-icons/285942/1 "2023-11-18T16:58:28Z")

</div>

在此处的 meta 上为链接添加标签说明时，标签显示会出错：

![funky tag](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/4X/b/7/b/b7b433d0a77ce9cf97ac937f357176a73e22697a.png)

---

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [2023年十一月18日 16:24 UTC](https://meta.discourse.org/t/links-in-tag-descriptions-aren-t-escaped-when-using-tag-icons/285942/2 "2023-11-18T16:24:09Z")

</div>

我看到：

![image](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/4X/8/e/f/8ef02ce381ad36b2849a28d0d26e48e6448bb854.png)

![image](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/original/4X/5/0/0/5006d5f048513468bb0149d1344cf6cc28435b5f.png)

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年十一月18日 16:27 UTC](https://meta.discourse.org/t/links-in-tag-descriptions-aren-t-escaped-when-using-tag-icons/285942/3 "2023-11-18T16:27:19Z")

</div>

嗯，不确定那里发生了什么。🤷 我现在会删除描述，但希望能解决这个问题。🤞

---

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [2023年十一月18日 16:43 UTC](https://meta.discourse.org/t/links-in-tag-descriptions-aren-t-escaped-when-using-tag-icons/285942/5 "2023-11-18T16:43:15Z")

</div>

它失败了，因为 Meta 使用 [Tag Icons](https://meta.discourse.org/t/tag-icons/109757)，并且需要更新以匹配核心。否则，链接将不会被转义。

我之前提交了一个 PR：

> <https://github.com/discourse/discourse-tag-icons/pull/15/files>
>
> Related core commits:
> \* \[#21391\](https://github.com/discourse/discourse/pull/21…391) - \[diff\](https://github.com/discourse/discourse/pull/21391/files#diff-f64eb8f03ac197dd71d469478344dbbb67943445e45133320234ad963f02de36)
> \* \[#22994\](https://github.com/discourse/discourse/pull/22994) - \[diff\](https://github.com/discourse/discourse/pull/22994/files#diff-f64eb8f03ac197dd71d469478344dbbb67943445e45133320234ad963f02de36)
> \* \[#23675\](https://github.com/discourse/discourse/pull/23675) - \[diff\](https://github.com/discourse/discourse/pull/23675/files#diff-f64eb8f03ac197dd71d469478344dbbb67943445e45133320234ad963f02de36)
> \* \[#23790\](https://github.com/discourse/discourse/pull/23790) - \[diff\](https://github.com/discourse/discourse/pull/23790/files#diff-f64eb8f03ac197dd71d469478344dbbb67943445e45133320234ad963f02de36)
> 
> This syncs the latest changes from \[\`render-tag.js\`\](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/render-tag.js).

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年十一月18日 17:00 UTC](https://meta.discourse.org/t/links-in-tag-descriptions-aren-t-escaped-when-using-tag-icons/285942/6 "2023-11-18T17:00:31Z")

</div>

我把它单独分到了 #Contribute > Bug 主题里，希望这样能吸引大家关注 👀 👍

---

<div class="post-metadata">

**Author:** ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)\
**Post date:** [2023年十一月20日 18:14 UTC](https://meta.discourse.org/t/links-in-tag-descriptions-aren-t-escaped-when-using-tag-icons/285942/8 "2023-11-20T18:14:36Z")

</div>

谢谢，您的 PR 现已合并。

---

<div class="post-metadata">

**Author:** ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)\
**Post date:** [2023年十一月21日 13:00 UTC](https://meta.discourse.org/t/links-in-tag-descriptions-aren-t-escaped-when-using-tag-icons/285942/9 "2023-11-21T13:00:47Z")

</div>

此主题已在 18 小时后自动关闭。不再允许回复。
