feat: 생성되는 마크다운을 git-style 링크로 감싸도록 변경 - #5
Merged
Conversation
GitHub은 링크 없는 마크다운 이미지를 렌더링할 때 camo 프록시 URL을 가리키는 <a>로 자동 감싼다. 그 결과 사용자가 프로필에 붙인 배지를 클릭하면 camo.githubusercontent.com의 원본 PNG로 이동했다. 명시적 링크를 주면 GitHub이 이를 보존하므로, 생성 스니펫을 [](https://git-style.vercel.app) 형태로 변경했다. 마크다운 조립 로직이 PreviewCard 본문에 인라인으로 있어 컴포넌트 외부에서 검증할 수 없었으므로, 순수 함수로 lib/utils/markdown.ts에 추출한 뒤 동작을 변경했다. 쿼리스트링 생성 규칙은 그대로다. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01La1oXcrwEZycnLJGdkFn3y
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
변경 사항
생성되는 마크다운 스니펫을 링크로 감싸도록 변경했습니다.
왜 필요한가
GitHub은 링크 없는 마크다운 이미지를 렌더링할 때 camo 프록시 URL을 가리키는
<a>로 자동으로 감쌉니다. 그 결과 사용자가 프로필에 붙인 배지를 클릭하면 프록시된 원본 PNG로 이동합니다.GitHub Markdown API로 두 형태를 렌더링해 확인한 결과:
<a href>https://camo.githubusercontent.com/8d83...← 현재[](target)target← 명시한 링크가 보존됨이 도구를 쓰는 모든 사용자가 동일하게 영향을 받고 있어 생성부에서 고치는 것이 맞다고 판단했습니다.
링크 타깃:
https://git-style.vercel.app. 배지를 본 사람이 "나도 만들래"가 되는 지점이 서비스 페이지이므로, 유입에서 생성까지 한 번에 이어집니다.구조 변경
마크다운 조립 로직이
PreviewCard컴포넌트 본문에 인라인으로 있어 외부에서 검증할 수 없었습니다. 순수 함수로lib/utils/markdown.ts에 추출한 뒤 동작을 변경했습니다. 테스트를 쓰기 위한 최소 조건이며,PreviewCard는 오히려 짧아졌습니다.buildAnimationPath()— 쿼리스트링 생성 (규칙 변경 없음)buildMarkdown()— 마크다운 스니펫 생성 (이번 변경 지점)변경 유형
관련 이슈
없음
테스트 방법
테스트 프레임워크가 없어 검증 스크립트로 확인했습니다. 추출만 먼저 하고 실패를 확인한 뒤 동작을 변경했습니다 — 경로 3건이 통과한 것이 추출이 기존 동작을 정확히 보존했다는 증거입니다.
로컬 dev 서버에서 실제 UI 확인 (username
octocat):API 회귀 확인 — 생성된 경로가 그대로 200을 반환합니다:
?theme=flower&quality=low&flower=defaultimage/png?theme=hair&quality=low&curliness=wavyimage/png체크리스트
pnpm lint통과 (49개 파일)pnpm build통과 (exit 0)스크린샷 (UI 변경 시)
— 클릭 시 camo 프록시로 이동[](https://git-style.vercel.app)— 클릭 시 서비스로 이동🤖 Generated with Claude Code
https://claude.ai/code/session_01La1oXcrwEZycnLJGdkFn3y