# 양식 템플릿 컴포저 필드의 줄바꿈이 편집 미리보기에서 사라짐

**URL:** https://meta.discourse.org/t/form-template-composer-fields-lose-their-newlines-in-the-edit-preview/411146
**Category:** Bug
**Tags:** form-templates
**Created:** [8월 28, 2026, 1:24오후 UTC](https://meta.discourse.org/t/form-template-composer-fields-lose-their-newlines-in-the-edit-preview/411146 "2026-08-28T13:24:25Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![ScaryLarryGames1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scarylarrygames1/32/575669_2.png) [@ScaryLarryGames1](https://meta.discourse.org/u/ScaryLarryGames1)
#### Post date: [8월 28, 2026, 1:24오후 UTC](https://meta.discourse.org/t/form-template-composer-fields-lose-their-newlines-in-the-edit-preview/411146/1 "2026-08-28T13:24:25Z")

</div>

폼 템플릿을 사용하는 게시글을 편집할 때, 작성기 미리보기에서 여러 줄에 걸친 `composer` 필드가 한 줄로 이어지는 형태로 렌더링됩니다. 제목은 그 뒤의 문장에 붙어 있고, 목록과 BBCode는 리터럴 텍스트로 표시됩니다. 저장된 게시글은 올바르게 처리(cook)되지만, 미리보기만 잘못 표시됩니다.

**원인:** `form-template-field/composer.gjs`는 네이티브 검증을 위해 각 작성기 필드를 숨겨진 `<input type="text">`으로 복제합니다:

```plaintext
<input id={{this.validationInputId}} type="text" name={{@id}} value={{this.composerValue}} ... class="form-template-field__composer-hidden-input" />

```

미리보기에서 처리(cook)되는 작성기 응답은 이러한 입력값으로부터 조립됩니다. HTML 값 정화 규칙에 따라 `type="text"` 입력 필드는 할당 시 CR/LF를 제거하므로, 미리보기가 값을 볼 때쯤이면 필드 값의 모든 줄바꿈이 사라져 있습니다. 저장은 편집기 자체를 읽기 때문에 저장된 원본(raw)에는 영향을 미치지 않습니다.

**재현 방법** (2026.9.0-latest): `composer` 필드가 있는 어떤 폼 템플릿이든 → 빈 줄을 포함하는 텍스트 입력(예: `## heading`, 단락, 목록) → 저장된 게시글에서 편집 열기 → 게시글 자체는 정상적으로 렌더링되지만 미리보기에는 한 줄로 평탄화된 형태로 표시됩니다.

**테마로 적용 중인 임시 해결책:** 숨겨진 입력 필드를 `type="hidden"`으로 변경(할당 시 줄바꿈을 보존함), 필드 편집기에서 이미 평탄화된 값을 복구하고, 응답이 다시 조립되도록 하나의 input 이벤트를 디스패치합니다. 이렇게 하면 미리보기가 완전히 복구됩니다.

코어 수정을 위한 참고 사항: `type="hidden"`은 네이티브 `required` 제약 조건 검증을 건너뛰므로, 대체 컨트롤은 텍스트 입력 필드보다는 시각적으로 숨겨진 `<textarea>`가 적절할 것입니다.

---

_[View the full topic](https://meta.discourse.org/t/form-template-composer-fields-lose-their-newlines-in-the-edit-preview/411146)._
