V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
davinci21s
V2EX  ›  问与答

chatgpt API 返回的 markdown 渲染请教

  •  
  •   davinci21s · Mar 2, 2023 · 1543 views
    This topic created in 1165 days ago, the information mentioned may be changed or developed.

    本人用 swift 写的 app ,用 markdown 渲染,遇到问题,内容类似这样: (代码贴 v2 这里貌似会被渲染,显示不完成,故以图片代替)

    img

    理论上所有的内容应该都在这个(绿色?)容器这里,但是遇到换行符号后就露出来了(所以的文字应在绿色框内)。。
    将\n\n 替换成<br>后没有换行效果了。。

    难道是渲染用的第三方 markdown 库不支持?

    img

    davinci21s
        1
    davinci21s  
    OP
       Mar 2, 2023
    已经搞定了,将 span 改成 div 马上正常了。。
    ![img]( https://usrn.xuanyuanhuangdi.org/all.png)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   851 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 20:33 · PVG 04:33 · LAX 13:33 · JFK 16:33
    ♥ Do have faith in what you're doing.