We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2590242 commit ca486edCopy full SHA for ca486ed
client/web/plugins/com.msgbyte.bbcode/src/tags/UrlTag.tsx
@@ -7,11 +7,16 @@ export const UrlTag: React.FC<TagProps> = React.memo((props) => {
7
const text = node.content.join('');
8
const url = node.attrs.url ?? text;
9
10
- if (url.startsWith('/') || url.startsWith(window.location.origin)) {
+ if (url.startsWith('/')) {
11
// 内部地址,使用 react-router 进行导航
12
return <Link to={url}>{text}</Link>;
13
}
14
15
+ if (url.startsWith(window.location.origin)) {
16
+ // 内部地址,使用 react-router 进行导航
17
+ return <Link to={url.replace(window.location.origin, '')}>{text}</Link>;
18
+ }
19
+
20
return (
21
<a href={url} title={text} target="_blank" rel="noopener noreferrer">
22
{text}
0 commit comments