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);