Skip to content

feat: footnote 기능 추가#673

Open
vanillacake369 wants to merge 4 commits into
velopert:masterfrom
vanillacake369:feat/footnote
Open

feat: footnote 기능 추가#673
vanillacake369 wants to merge 4 commits into
velopert:masterfrom
vanillacake369:feat/footnote

Conversation

@vanillacake369
Copy link
Copy Markdown

@vanillacake369 vanillacake369 commented May 11, 2026

개요

마크다운 각주 문법(`[^1]`, `^[인라인 각주]`)을 지원합니다.

변경사항

  • remark-footnotes@2.0.0 추가 (remark v11 / unified v8 호환)
  • MarkdownRender remark 파이프라인에 footnotes 플러그인 연결 (SSR + 클라이언트)
  • sanitize-html 허용 태그에 `sup`, `section` 추가 (각주 HTML 보존)
  • 각주 영역 스타일 추가 (구분선, 참조 번호 위첨자, 백링크)

테스트

# 단위 + sanitize 통합 테스트 (9개)
node scripts/test.js --watchAll=false --testPathPattern="src/lib/remark/__tests__/footnote"

# 시각 테스트 (백엔드 불필요)
open test-footnote.html

논의사항

이슈 : remark-footnotes 버전 호환성

remark-footnotes v3+는 unified v10을 요구하여 현재 프로젝트(remark v11 / unified v8)와 호환되지 않습니다. 이로 인해 최신 버전의 기능과 버그 수정을 받을 수 없습니다.

대안

이에 대해 다음과 같은 대안들이 있으며, 현재는 v2.0.0을 선택하여 기존 unified 생태계를 유지하고 있습니다. v2.0.0이 외부 의존성 없이 현재 파이프라인에 바로 통합 가능한 유일한 호환 버전이기 때문입니다.

대안 장점 단점
remark-footnotes@2.0.0 (현재) 현재 remark v11과 호환, 외부 의존성 없음, 즉시 적용 가능 최신 기능·수정 미반영
remark/unified 메이저 업그레이드 + v4+ 최신 생태계, 장기 유지보수 유리 전체 파이프라인 마이그레이션 필요, 영향 범위 큼

리뷰어 요청사항 : 인라인 각주(`^[내용]`)를 활성화(`inlineNotes: true`)한 상태인데, 표준 각주(`[^1]`)만 지원하는 것이 적절한지에 대해 의견 부탁드립니다

Add remark-footnotes v2 which is compatible with the existing
remark v11 / unified v8 ecosystem.
- Add remark-footnotes plugin to remark pipeline (SSR + client)
- Enable inline notes syntax (^[inline note])
- Add sup and section to sanitize-html allowed tags
- Add footnote styles (separator, backref, superscript ref)
- 5 unit tests: basic, multiple, inline, no-footnote, formatted content
- 4 sanitize tests: ref link, content, class preservation, XSS prevention
Standalone HTML page for verifying footnote rendering
without requiring backend server setup.
@vanillacake369 vanillacake369 changed the title feat: add markdown footnote support feat: footnot 기능 추가 May 11, 2026
@vanillacake369 vanillacake369 changed the title feat: footnot 기능 추가 feat: footnote 기능 추가 May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant