链接内部React Markdown主体未打开在新标签中

发布于 2025-01-25 15:20:07 字数 370 浏览 1 评论 0原文

我正在研究一个React应用程序,在该应用程序中,我正在渲染React Markdown格式中的内容,其中还包含链接。

<div>
   <ReactMarkdown>{this.state.post.body}</ReactMarkdown>
</div>

在这个主体中,有一个链接链接格式,但是当我单击它时呈现时,它将我的React页面URL并嵌入最后一个链接,并在最后一个链接打开并打开了明显的链接。

在Markdown中,链接文本以这种格式:

[bit.ly/3sZbeYG](bit.ly/3sZbeYG)

有人可以帮助我吗?

I am working on a react app where I am rendering a content inside react markdown format where it also contains link.

<div>
   <ReactMarkdown>{this.state.post.body}</ReactMarkdown>
</div>

In this body,there is a link in markdown format but while rendering when I click on it,it takes my react page url and embed that link at the last and open which obviosuly doesnt work.

In markdown the link text is in this format:

[bit.ly/3sZbeYG](bit.ly/3sZbeYG)

Can someone help me with this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海不蓝 2025-02-01 15:20:07

简单的出路是使

道路绝对

[link](https://google.com)

The Easy way out is making

The Path absolute

[link](https://google.com)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文