gpt4 book ai didi

ruby-on-rails - 从 wiki 转换为 html

转载 作者:行者123 更新时间:2023-12-04 06:23:11 25 4
gpt4 key购买 nike

我正在使用维基百科 api 从维基百科获取信息。
有什么可以在 html 中转换 wiki 文本的吗?

我试过 mediacloth 但效果不佳

最佳答案

看看marker .

>> require 'marker'
>> m = Marker.parse "== heading ==\nparagraph with '''bold''' text"
>> puts m.to_html
<h2>heading</h2>
<p>paragraph with <b>bold</b> text</p>

关于ruby-on-rails - 从 wiki 转换为 html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2314233/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com