feat(editor): :name: shortcode -> emoticon 이미지 치환#658
Closed
seong-jin-jo wants to merge 1 commit into
Closed
Conversation
…이미지로 치환 - markdown-content.tsx의 sanitize 직전 단계에 replaceEmoticonShortcodes 추가 - :okay:, :aha_lg:, :okay_xxl: 등 size variant 4단 지원 (24/48/96/150px) - markdown-sanitizer.ts ALLOWED_URI_REGEXP에 /emoticon/ prefix 허용 - public/emoticon/에 캐릭터 자산 20종 추가 - catalog 외 토큰은 텍스트로 그대로 노출 — XSS 안전 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (20)
📒 Files selected for processing (3)
📝 WalkthroughWalkthrough사이트 공용 이모티콘을 마크다운 콘텐츠 내 Changes이모티콘 단축코드 렌더링
Possibly Related PRs
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~12 minutes
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
:okay:같은 텍스트 토큰을MarkdownContent렌더 시점에 사이트 캐릭터 이모티콘<img>로 자동 치환합니다.:okay:(24px, 인라인 기본) /:okay_lg:(48) /:okay_xl:(96) /:okay_xxl:(150, 강조 단독 배치용).LessonMarkdownPolicyService의images/lesson-content/whitelist + ResizedImage 등록 정책과 충돌하지 않습니다.:foo:등)은 텍스트 그대로 노출되어 XSS·오용 위험이 없습니다.Why
💡,🔥,🎉,🤔,😃,✅,🚀,🎓같은 emoji 마커가 풍부합니다. 이를 사이트 캐릭터 이모티콘으로 풀어 학습 본문의 톤·정체성을 일관화하기 위함입니다.Changes
src/components/common/ui/editor/emoticon-shortcode.ts(신규):EMOTICON_CATALOG(20종),EMOTICON_SIZE_CLASS(4단),replaceEmoticonShortcodes.src/components/common/ui/editor/markdown-content.tsx:replaceStandaloneYouTubeLinksWithEmbeds다음에replaceEmoticonShortcodes호출 +[&_img.emoticon-inline / .emoticon-lg / .emoticon-xl / .emoticon-xxl]CSS 추가.src/components/common/ui/editor/markdown-sanitizer.ts:ALLOWED_URI_REGEXP에\/emoticon\/prefix 허용.public/emoticon/*.png(20종): 캐릭터 이모티콘 정적 자산.영향 범위
MarkdownContent사용처 전부: 레슨 본문, 커뮤니티 게시글, 멘토링 소개 등 사이트 전반의 rich-text 렌더링.:name:패턴이 우연히 포함되어 있을 가능성은 낮으나, catalog에 없는 토큰은 텍스트 그대로 보이므로 회귀 위험은 최소화됩니다.Test plan
:okay::okay_lg::okay_xl::okay_xxl:입력 → 미리보기에 각 사이즈 이미지가 표시되는지 확인:foo:)이 raw 텍스트로 그대로 보이는지 확인<script>:okay:</script>)가 차단되는지 확인:aha_xxl:등 shortcode가 들어가 있어, 머지·배포 후 사이트에서 이미지로 자동 렌더되는지 확인🤖 Generated with Claude Code
Summary by CodeRabbit
:okay:형식)가 마크다운 콘텐츠에서 실제 이미지로 자동 변환됩니다._lg,_xl,_xxl)을 지원합니다.