From 1a4666e339f955c1d2d950254d04bfaf85639f55 Mon Sep 17 00:00:00 2001 From: windpacer Date: Sun, 24 May 2026 12:47:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20box-drawing=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=20=ED=96=89=20=EB=B6=84=EB=A6=AC=20=EB=AC=B8=EC=A0=9C?= =?UTF-8?q?=20=E2=80=94=20=EC=A0=95=EA=B7=9C=EC=8B=9D=20prefix=EB=A7=8C=20?= =?UTF-8?q?=EA=B2=80=EC=82=AC=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - BOX_RE: 전체 라인 검사 → 선두 box-drawing 문자만 확인 - 셀 내부 ' % ( ) 등 모든 문자 허용되어 행 분리 방지 - CSS 백업: .md-body pre에 font-family: var(--fm) 추가 --- src/Web/wwwroot/css/docs.css | 1 + src/Web/wwwroot/js/docs.js | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/Web/wwwroot/css/docs.css b/src/Web/wwwroot/css/docs.css index 805c7a6..16b48ee 100644 --- a/src/Web/wwwroot/css/docs.css +++ b/src/Web/wwwroot/css/docs.css @@ -277,6 +277,7 @@ border-radius: 8px; overflow: auto; line-height: 1.5; + font-family: var(--fm); } .md-body pre code { background: transparent; diff --git a/src/Web/wwwroot/js/docs.js b/src/Web/wwwroot/js/docs.js index 1a6fdd6..6ae862a 100644 --- a/src/Web/wwwroot/js/docs.js +++ b/src/Web/wwwroot/js/docs.js @@ -332,7 +332,25 @@ function docsExportPdf() { } /* ── 마크다운 렌더 파이프라인 ──────────────────────────────── */ + +/// box-drawing 문자(┌─┬┐│├─┼┤└─┴┘) 라인을 fenced code block으로 감싸 고정폭 렌더링 보장 +function docsWrapBoxDrawing(text) { + const BOX_RE = /^[ \t]*[┌┐└┘├┤┬┴┼│─━]/; + const lines = text.split('\n'); + const out = []; + let inBlock = false; + for (const line of lines) { + const isBox = BOX_RE.test(line); + if (isBox && !inBlock) { out.push('```'); inBlock = true; } + else if (!isBox && inBlock) { out.push('```'); inBlock = false; } + out.push(line); + } + if (inBlock) out.push('```'); + return out.join('\n'); +} + function docsRenderMarkdownInto(el, text) { + text = docsWrapBoxDrawing(text); const rawHtml = marked.parse(text, { gfm: true, breaks: false }); el.innerHTML = DOMPurify.sanitize(rawHtml, { ADD_TAGS: ['details', 'summary'], ADD_ATTR: ['target'] }); docsExternalLinks(el);