fix: 헤딩 앵커 링크 변환 시 HTML 포맷팅 보존하도록 수정 #283
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #282
문제점
헤딩에 굵게, 기울임 등의 서식이 적용된 경우, 앵커 링크로 변환되는 과정에서 HTML 서식이 제거되어 시각적 스타일이 사라지는 문제가 있었습니다.
수정 전:
수정 후:
해결방법
Content.pug의setAnchorToHeading메서드에서textContent대신innerHTML을 사용하도록 변경:textContent는 모든 HTML 태그를 제거innerHTML은 원본 HTML 구조를 보존변경사항
assets/pug/Mixins/Permalink/Content.pug수정textContent에서innerHTML로 변경innerHTML설정테스트 결과
스크린샷