将字符串从API调用转换为Markdown语法?
假设我有一个(GraphQL)API调用,该调用返回以下内容:
node {
"body": "* Hello\r\n\r\n_World_",
}
在
* Hello
_World_
原始降价中。
(更具体地说,我正在获取GitHub发表评论。我知道GitHub API中的HTML有一个选择,但是我只是好奇。)
是否有任何简单的方法可以将其转变为JavaScript中的Markdown?没有正则。
Let's say I have a (graphQL) API call that returns the following:
node {
"body": "* Hello\r\n\r\n_World_",
}
Which is
* Hello
_World_
in the original Markdown.
(To be more specific, I'm fetching github issues comments. I know there's an option for HTML in the github API, but I'm just curious.)
Is there any easy way to turn that back to Markdown in javascript? Without regex.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论