Skip to content

[refactor] 텍스트 URL 링크화 로직을 통합한다#1145

Merged
suhyun113 merged 4 commits intodevelop-fefrom
refactor/#1143-url-linkify-util-consolidation-MOA-605
Feb 8, 2026
Merged

[refactor] 텍스트 URL 링크화 로직을 통합한다#1145
suhyun113 merged 4 commits intodevelop-fefrom
refactor/#1143-url-linkify-util-consolidation-MOA-605

Conversation

@suhyun113
Copy link
Collaborator

@suhyun113 suhyun113 commented Feb 6, 2026

#️⃣연관된 이슈

ex) #1143

📝작업 내용

링크 파싱 로직 통합

변경 사항

  • parseDescriptionWithLinks 제거하고 linkifyText로 링크 파싱 로직 통합
  • 불필요한 LinkifiedText 컴포넌트 제거 후 유틸 직접 사용하도록 정리
  • 외부 URL을 새 탭에서 열리도록 수정하고 rel="noopener noreferrer" 추가

변경 이유

  • 중복된 링크 처리 로직을 하나로 통합해 유지보수성 개선
  • 역할 없는 컴포넌트를 제거해 렌더링 구조 단순화

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

릴리스 노트

  • 개선 사항

    • 외부 링크가 새 탭에서 열리고 보안 속성(rel, noopener)이 적용되어 안전성이 향상되었습니다.
    • 설명 및 콘텐츠 전반에서 링크 표시 방식이 통일되어 사용자 경험이 일관됩니다.
  • 리팩토

    • 중복된 링크 래퍼 컴포넌트를 제거하고 링크 처리 유틸리티를 통합해 코드가 간결해졌습니다.

@suhyun113 suhyun113 self-assigned this Feb 6, 2026
@suhyun113 suhyun113 added 🔨 Refactor 코드 리팩토링 💻 FE Frontend labels Feb 6, 2026
@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moadong Ready Ready Preview, Comment Feb 8, 2026 10:55am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

URL 링크화 유틸리티를 통합하는 리팩토링으로, 기존 parseDescriptionWithLinksLinkifiedText 래퍼를 제거하고 호출부를 linkifyText로 통일하며, 생성되는 링크에 target="_blank"rel="noopener noreferrer" 보안 속성을 추가합니다.

Changes

Cohort / File(s) Summary
유틸리티 변경
frontend/src/utils/parseDescriptionWithLinks.tsx, frontend/src/utils/linkifyText.tsx
parseDescriptionWithLinks 삭제; linkifyTexttarget="_blank"rel="noopener noreferrer" 속성 추가.
컴포넌트 제거
frontend/src/pages/ClubDetailPage/components/ClubIntroContent/LinkifiedText.tsx
LinkifiedText 래퍼 컴포넌트 파일 삭제 (단순 wrapper 제거).
호출부 업데이트
frontend/src/pages/ClubDetailPage/components/ClubIntroContent/ClubIntroContent.tsx, frontend/src/pages/ApplicationFormPage/ApplicationFormPage.tsx
LinkifiedText 사용을 제거하고 직접 linkifyText(...) 호출로 변경, 관련 import 정리.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • lepitaaar
  • seongwon030
  • oesnuj
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 pull request의 주요 변경 사항을 명확하게 설명합니다. URL 링크화 로직을 통합한다는 핵심 목표를 잘 나타냅니다.
Linked Issues check ✅ Passed PR의 모든 변경사항이 MOA-605 이슈의 목표(링크화 로직 통합, 중복 제거, 관련 컴포넌트 정리)를 충족합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 URL 링크화 로직 통합이라는 범위 내에 있습니다. 불필요한 컴포넌트 제거와 보안 속성 추가도 해당 목표와 직접적으로 관련됩니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#1143-url-linkify-util-consolidation-MOA-605

No actionable comments were generated in the recent review. 🎉


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/utils/linkifyText.tsx (1)

4-4: ⚠️ Potential issue | 🟠 Major

URL 정규식에 & 등 주요 URL 문자가 누락되어 있습니다.

URL_MATCH_REGEX의 문자 클래스에 &가 포함되어 있지 않아, 쿼리 파라미터가 있는 URL(예: https://example.com/path?a=1&b=2)이 & 앞에서 잘립니다. 또한 ~, @, +, : (포트 번호 등) 같은 유효한 URL 문자도 빠져 있습니다.

이번 PR의 범위(변경된 라인은 46-47)에는 해당하지 않지만, 통합 유틸로 사용되는 만큼 영향 범위가 넓어집니다.

🔧 정규식 수정 제안
-const URL_MATCH_REGEX = /https?:\/\/[a-zA-Z0-9./?=#_%\-]+/g;
+const URL_MATCH_REGEX = /https?:\/\/[a-zA-Z0-9./?=#_%\-&~@+:!,;()'[\]]+/g;

Copy link
Member

@seongwon030 seongwon030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rel="noopener noreferrer" 가 각각 어떤 역할을 하나요 ??

@suhyun113
Copy link
Collaborator Author

rel="noopener noreferrer" 가 각각 어떤 역할을 하나요 ??

원래 같은 탭에서 열리도록 하려했는데, 외부 링크의 경우 새 탭으로 여는 방식이 보안적인 측면에서 더 낫다는 걸 알게되었습니다.

다만 target_"_blank" 만 사용할 경우 새로 열린 페이지가 window.opener를 통해 기존 페이지를 제어할 수 있는 탭 하이재킹 취약점이 발생할 수 있습니다.

따라서 rel 속성에 noopener를 추가했고,
링크 이동 시 HTTP referer 헤더를 전송하지 않도록 하여 사용자가 어떤 페이지에서 이동했는지 외부 사이트에 노출되지 않도록 noreferrer를 추가했습니다.

@suhyun113 suhyun113 force-pushed the refactor/#1143-url-linkify-util-consolidation-MOA-605 branch from d11d595 to 713c7f7 Compare February 8, 2026 10:49
@suhyun113 suhyun113 merged commit 905c99f into develop-fe Feb 8, 2026
4 checks passed
@suhyun113 suhyun113 deleted the refactor/#1143-url-linkify-util-consolidation-MOA-605 branch February 8, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FE Frontend 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants