# Символ & отображается неправильно в синхронизированных событиях

**URL:** https://meta.discourse.org/t/ampersand-not-displaying-properly-in-synchronised-events/400166
**Category:** Bug
**Tags:** events, fixed
**Created:** [08.Апрель.2026 00:00:42 UTC](https://meta.discourse.org/t/ampersand-not-displaying-properly-in-synchronised-events/400166 "2026-04-08T00:00:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [08.Апрель.2026 00:00:42 UTC](https://meta.discourse.org/t/ampersand-not-displaying-properly-in-synchronised-events/400166/1 "2026-04-08T00:00:42Z")

</div>

Мне очень нравится новый функционал [Calendar subscription URLs for external calendar apps](https://meta.discourse.org/t/calendar-subscription-urls-for-external-calendar-apps/398902) — просто отлично!

Это небольшая ошибка, которую я заметил при реальном использовании. Когда в заголовке события в моём экземпляре встречается амперсанд (то есть `&`), синхронизированное событие в календаре Google отображается как HTML-сущность (`&amp;`) вместо него.

Например, на моём сайте:

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/7/4/e74b3b8fce926f2491bd688df61eaf4cfeedfbf2.png)

А в моём календаре Google:

 ![image](https://global.discourse-cdn.com/meta/original/4X/c/1/a/c1acaa784a0879f77623a416e945c8153b1f0280.png)

Когда событие добавляется напрямую в календарь Google, всё работает корректно, и я не замечал проблем с другими символами.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [08.Апрель.2026 14:12:00 UTC](https://meta.discourse.org/t/ampersand-not-displaying-properly-in-synchronised-events/400166/2 "2026-04-08T14:12:00Z")

</div>

Спасибо за отчет @nathank 👍 Это будет исправлено в

> <https://github.com/discourse/discourse/pull/39152>
>
> ERB's \`\<%= %\>\` calls \`ERB::Util.html\_escape\` on all non-\`html\_safe\` strings, eve…n in non-HTML templates like \`.ics.erb\`. This caused ampersands (and potentially other special characters) to be double-encoded as \`&amp;\` in calendar subscription feeds, which external calendar apps like Google Calendar displayed verbatim.
> 
> Mark \`IcalEncoder.encode\` output as \`html\_safe\` since it already performs all necessary ICS encoding (HTML sanitization, entity decoding, RFC 5545 escaping). Also route the URL fields in both ICS templates through \`IcalEncoder.encode\` for consistency.
> 
> https://meta.discourse.org/t/400166

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [08.Апрель.2026 20:26:16 UTC](https://meta.discourse.org/t/ampersand-not-displaying-properly-in-synchronised-events/400166/3 "2026-04-08T20:26:16Z")

</div>

Да, могу подтвердить, что это уже исправлено!

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/0/d/e0d5c3a3dc2bb4c2795eca68769823dd0e7acac0.png)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [09.Апрель.2026 06:57:44 UTC](https://meta.discourse.org/t/ampersand-not-displaying-properly-in-synchronised-events/400166/4 "2026-04-09T06:57:44Z")

</div>


