# Onebox에서 Discourse의 & 이스케이프 처리

**URL:** https://meta.discourse.org/t/discourse-escaping-in-onebox/377587
**Category:** Bug
**Tags:** onebox
**Created:** [8월 6, 2025, 5:01오후 UTC](https://meta.discourse.org/t/discourse-escaping-in-onebox/377587 "2025-08-06T17:01:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [8월 6, 2025, 5:01오후 UTC](https://meta.discourse.org/t/discourse-escaping-in-onebox/377587/1 "2025-08-06T17:01:06Z")

</div>

이것이 회귀 버그(regression)인지는 확실하지 않지만, 오늘 한 사용자가 이 문제를 보고했습니다.

```html
<meta property="og:description" content="The Name & Location Library.">

```

Oneboxing 결과:

```plaintext
The Name &amp; Location Library.

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [8월 7, 2025, 12:24오전 UTC](https://meta.discourse.org/t/discourse-escaping-in-onebox/377587/2 "2025-08-07T00:24:29Z")

</div>

이전에 비슷한 사례를 본 적 있습니다… 실제 운영 환경에서 사용된 예시가 있을까요?

---

<div class="post-metadata">

### Author: ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)
#### Post date: [8월 7, 2025, 12:58오전 UTC](https://meta.discourse.org/t/discourse-escaping-in-onebox/377587/3 "2025-08-07T00:58:36Z")

</div>

여기 있습니다:

[https://github.com/nshkrdotcom/ALTAR/tree/main/specs](https://github.com/nshkrdotcom/ALTAR/tree/main/specs)

---

<div class="post-metadata">

### Author: ![loic](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/loic/32/105621_2.png) [@loic](https://meta.discourse.org/u/loic)
#### Post date: [1월 16, 2026, 10:45오전 UTC](https://meta.discourse.org/t/discourse-escaping-in-onebox/377587/7 "2026-01-16T10:45:10Z")

</div>

해당 문제를 해결하는 패치를 방금 병합했습니다(모든 Onebox에서 해결되어야 합니다):

> <https://github.com/discourse/discourse/pull/37141>
>
> Sometimes, HTML entities can be escaped twice, typically when getting sanitized …data from our \`Onebox::OpenGraph\` class then providing that value to a template. We’re using the Mustache gem to process the Onebox templates, and it will automatically escape HTML entities. This is usually not a problem, but it is for things like ampersands. For example, if the value we provide to the template is \`&amp;\`, then Mustache will convert it to \`&amp;amp;\`.
> 
> This PR fixes that behavior by decoding the result of the sanitization we apply in \`Onebox::OpenGraph\`. That way, templates will get \`&\` instead of \`&amp;\`, thus there won’t be any double escaping.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [1월 19, 2026, 9:53오전 UTC](https://meta.discourse.org/t/discourse-escaping-in-onebox/377587/9 "2026-01-19T09:53:03Z")

</div>


