Skip to content

Commit 0dabf20

Browse files
authored
Merge pull request #13 from MoonlightSmile/main
feat: 评论内容 @人名 可跳转 web
2 parents 251cb9a + c88b81d commit 0dabf20

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

V2exOS/Views/TopicDetail/CommentListView.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,16 @@ struct CommentListView: View {
5555
}
5656
.foregroundColor(Color(NSColor.tertiaryLabelColor))
5757

58-
Markdown(comment.content)
59-
.font(.body)
58+
Markdown(
59+
comment.content
60+
.replacingOccurrences(
61+
of: #"@(\w+)"#,
62+
with: "[$0](https://www.v2ex.com/member/$1)",
63+
options: .regularExpression,
64+
range: nil
65+
)
66+
)
67+
.font(.body)
6068
}
6169
}
6270
}

0 commit comments

Comments
 (0)