케이스 ce-0136-code-block-paste-formats-ko · 시나리오 scenario-code-block-editing

코드 블록에 서식이 있는 콘텐츠를 붙여넣으면 코드 구조가 손실됨

OS: Windows 11 기기: Desktop or Laptop Any 브라우저: Firefox 120.0 키보드: US 초안
codeprepasteformattingfirefox

현상

Firefox에서 코드 블록에 서식이 있는 콘텐츠(HTML 서식 포함)를 붙여넣을 때 서식은 보존되지만 코드 블록 구조가 손실될 수 있습니다. 코드 블록이 일반 단락으로 변환될 수 있습니다.

재현 예시

  1. 코드 블록을 만듭니다: <pre><code>function test() {</code></pre>
  2. 그 안에 서식이 있는 HTML 콘텐츠를 붙여넣습니다
  3. DOM 구조를 관찰합니다

관찰된 동작

  • 코드 블록 구조가 손실됩니다
  • <pre><code><p> 요소로 변환될 수 있습니다
  • 서식은 보존되지만 코드 컨텍스트가 손실됩니다
  • 코드 블록이 깨집니다

예상 동작

  • 코드 블록 구조가 유지되어야 합니다
  • 서식이 제거되어야 합니다 (코드는 일반 텍스트여야 함)
  • 코드 블록이 <pre><code>로 유지되어야 합니다
  • 구조가 보존되어야 합니다

브라우저 비교

  • Chrome/Edge: 구조를 보존하거나 깨뜨릴 수 있음
  • Firefox: 구조를 깨뜨릴 가능성이 더 높음 (이 케이스)
  • Safari: 구조를 깨뜨릴 가능성이 가장 높음

참고 및 해결 방법 가능한 방향

  • 코드 블록에서 붙여넣기 가로채기
  • 붙여넣은 콘텐츠에서 모든 서식 제거
  • 코드 블록 구조 보존
  • HTML을 일반 텍스트로 변환

이 시나리오의 변형

케이스 OS 브라우저 상태
ce-0108-code-block-whitespace-chrome-ko Windows 11 Chrome 120.0 초안
ce-0136-code-block-paste-formats-ko Windows 11 Firefox 120.0 초안
ce-0147-code-block-line-breaks-lost-ko Windows 11 Chrome 120.0 초안
ce-0157-code-block-formatting-allowed-ko Windows 11 Chrome 120.0 초안
ce-0170-code-block-indentation-lost-ko Windows 11 Chrome 120.0 초안

Playground for this case

Use the reported environment as a reference and record what happens in your environment while interacting with the editable area.

Reported environment
OS: Windows 11
Device: Desktop or Laptop Any
Browser: Firefox 120.0
Keyboard: US
Your environment
Sample HTML:
Event log
Use this log together with the case description when filing or updating an issue.
0 events
Interact with the editable area to see events here.