sqzass.git

sqzass

~ A static site generator written in Rust
git clone https://github.com/debuman/sqzass.git
commit cc7fc4ea0123bd404740c01a1dcfa2596e213c40
parent be2d3a70e22008fab2ba635124f2c5087cb4f28f
Author: sqzer <110329244+sqzer-x@users.noreply.github.com>
Date: Tue, 28 Jul 2026 21:33:17 +0900

복사 버튼 라벨을 선택에서 뺀다

버튼이 pre 안에 있어서 블록을 통째로 긁어 복사하면 코드 끝에 "Copy"가
따라왔다. 헤드리스 실측: pre 전체 선택의 직렬화가 `…let c = 3;\nCopy`.
user-select: none 한 줄로 코드만 남는다 — 줄 번호 레시피가 gutter에 쓰는
것과 같은 이유다.

같은 실측에서 확인한 것: 복사 버튼(code.textContent)은 mark·빈 줄·라벨이
있어도 원문과 바이트 동일하고, 드래그 선택은 display:block mark 경계에서
개행을 이중으로 넣지 않는다. 드래그 복사에서 마지막 개행 하나가 빠지는
것은 mark 없는 블록에서도 같은, 브라우저 선택 직렬화의 표준 동작이다.

Diffstat:
Mdocs/static/css/main.css | 3+++
1 file changed, 3 insertion(+), 0 deletion(-)

diff --git a/docs/static/css/main.css b/docs/static/css/main.css
@@ -546,6 +546,9 @@ h4:hover > .anchor, h5:hover > .anchor, h6:hover > .anchor,
   cursor: pointer;
   opacity: 0;
   transition: opacity var(--tr), color var(--tr), border-color var(--tr);
+  /* 버튼은 pre 안에 있어서, 블록을 통째로 긁어 복사하면 이 라벨까지 따라온다.
+     선택에서 빼면 복사문이 코드만 남는다 — 줄 번호 레시피와 같은 이유다. */
+  user-select: none;
 }
 .prose pre.highlight:hover .copy,
 .copy:focus-visible { opacity: 1; }