mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-13 13:33:42 +08:00
Update markdown.tsx
This commit is contained in:
@@ -96,7 +96,8 @@ export function Markdown(
|
|||||||
components={{
|
components={{
|
||||||
pre: PreCode,
|
pre: PreCode,
|
||||||
a: (aProps) => {
|
a: (aProps) => {
|
||||||
const isInternal = /^\/#/i.test(aProps.href);
|
const href = aProps.href || "";
|
||||||
|
const isInternal = /^\/#/i.test(href);
|
||||||
const target = isInternal ? "_self" : aProps.target ?? "_blank";
|
const target = isInternal ? "_self" : aProps.target ?? "_blank";
|
||||||
return <a {...aProps} target={target} />;
|
return <a {...aProps} target={target} />;
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user