From aaa397133a81ebb70c07a946fd4b8ca55597bf9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A2=85=ED=95=98?= Date: Fri, 31 Oct 2025 00:27:24 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=ED=97=A4=EB=94=A9=20=EC=95=B5?= =?UTF-8?q?=EC=BB=A4=20=EB=A7=81=ED=81=AC=20=EB=B3=80=ED=99=98=20=EC=8B=9C?= =?UTF-8?q?=20HTML=20=ED=8F=AC=EB=A7=B7=ED=8C=85=20=EB=B3=B4=EC=A1=B4?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - setAnchorToHeading에서 textContent 대신 innerHTML 사용 - , 태그 등 원본 HTML 구조 유지 - 앵커 변환 과정에서 헤딩 서식이 사라지는 문제 해결 --- assets/pug/Mixins/Permalink/Content.pug | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/pug/Mixins/Permalink/Content.pug b/assets/pug/Mixins/Permalink/Content.pug index f4bae008..584ffa70 100644 --- a/assets/pug/Mixins/Permalink/Content.pug +++ b/assets/pug/Mixins/Permalink/Content.pug @@ -173,10 +173,16 @@ script(once='alpine-article-component'). */ setAnchorToHeading ($heading, index) { const link = this.link($heading, index) - const $anchor = this.$anchor($heading, `#${link}`) $heading.setAttribute('id', link) - $heading.innerHTML = $anchor.outerHTML + + const originalHTML = $heading.innerHTML + const $anchor = document.createElement('a') + $anchor.setAttribute('href', `#${link}`) + $anchor.innerHTML = originalHTML + + $heading.innerHTML = '' + $heading.appendChild($anchor) }, /** From 66e86fc0ed77aa588e6580ace157ef8571c7cff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A2=85=ED=95=98?= Date: Fri, 7 Nov 2025 16:01:21 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20lint=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/pug/Mixins/Permalink/Content.pug | 2 -- 1 file changed, 2 deletions(-) diff --git a/assets/pug/Mixins/Permalink/Content.pug b/assets/pug/Mixins/Permalink/Content.pug index 584ffa70..1b3a9196 100644 --- a/assets/pug/Mixins/Permalink/Content.pug +++ b/assets/pug/Mixins/Permalink/Content.pug @@ -175,12 +175,10 @@ script(once='alpine-article-component'). const link = this.link($heading, index) $heading.setAttribute('id', link) - const originalHTML = $heading.innerHTML const $anchor = document.createElement('a') $anchor.setAttribute('href', `#${link}`) $anchor.innerHTML = originalHTML - $heading.innerHTML = '' $heading.appendChild($anchor) }, From 1b5fef6241d8c01c08fb15f6c473d308d89637a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EC=A2=85=ED=95=98?= Date: Fri, 7 Nov 2025 21:32:49 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20setAnchorToHeading=20=EB=A1=A4?= =?UTF-8?q?=EB=B0=B1=20=EB=B0=8F=20anchor=20=ED=95=A8=EC=88=98=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 --- assets/pug/Mixins/Permalink/Content.pug | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/assets/pug/Mixins/Permalink/Content.pug b/assets/pug/Mixins/Permalink/Content.pug index 1b3a9196..3f923fa2 100644 --- a/assets/pug/Mixins/Permalink/Content.pug +++ b/assets/pug/Mixins/Permalink/Content.pug @@ -173,14 +173,10 @@ script(once='alpine-article-component'). */ setAnchorToHeading ($heading, index) { const link = this.link($heading, index) + const $anchor = this.$anchor($heading, `#${link}`) $heading.setAttribute('id', link) - const originalHTML = $heading.innerHTML - const $anchor = document.createElement('a') - $anchor.setAttribute('href', `#${link}`) - $anchor.innerHTML = originalHTML - $heading.innerHTML = '' - $heading.appendChild($anchor) + $heading.innerHTML = $anchor.outerHTML }, /** @@ -207,7 +203,7 @@ script(once='alpine-article-component'). const $anchor = document.createElement('a') $anchor.setAttribute('href', link) - $anchor.textContent = $heading.textContent + $anchor.innerHTML = $heading.innerHTML return $anchor },