@@ -15,6 +15,9 @@ interface Props {
1515// hex 색상을 chalk 함수로 변환
1616const hex = ( color : string ) => chalk . hex ( color )
1717
18+ // TUI에서 하이퍼링크는 클릭 불가 → [text](url) 에서 URL 제거, 텍스트만 유지
19+ const HYPERLINK_PATTERN = / \[ ( [ ^ \] ] + ) \] \( [ ^ ) ] + \) / g
20+
1821// 인라인 인용 패턴: [이력서], [100문100답], [블로그: 제목], [지식: 제목] 등
1922const CITATION_PATTERN = / \[ ( 이 력 서 | 1 0 0 문 1 0 0 답 | 블 로 그 : \s * [ ^ \] ] + | [ ^ \] ] { 2 , 30 } ) \] / g
2023const citationStyle = chalk . hex ( theme . muted ) . dim
@@ -36,9 +39,7 @@ marked.use(
3639 em : chalk . italic ,
3740 codespan : hex ( theme . lavender ) ,
3841 del : hex ( theme . muted ) . strikethrough ,
39- link : hex ( theme . info ) ,
40- href : hex ( theme . info ) . underline ,
41- // 옵션
42+ // 옵션 (link/href 불필요: HYPERLINK_PATTERN으로 사전 제거)
4243 showSectionPrefix : false ,
4344 reflowText : true ,
4445 width : 80 ,
@@ -64,8 +65,10 @@ export function MarkdownText({ children, color }: Props) {
6465 if ( ! children ) return ''
6566
6667 try {
68+ // TUI: 하이퍼링크 URL 제거 (클릭 불가이므로 텍스트만 유지)
69+ const stripped = children . replace ( HYPERLINK_PATTERN , '$1' )
6770 // marked-terminal은 ANSI escape code가 포함된 문자열을 반환
68- let result = marked . parse ( children , { async : false } ) as string
71+ let result = marked . parse ( stripped , { async : false } ) as string
6972 // 끝의 불필요한 줄바꿈 제거
7073 result = result . replace ( / \n + $ / , '' )
7174 // 인라인 인용 스타일링: [이력서] → dim muted 색상
0 commit comments