Convert HTML to plain text (with inclusion of
s)

后端 未结 5 846
-上瘾入骨i
-上瘾入骨i 2021-02-06 01:39

Is it possible to convert HTML with Nokogiri to plain text? I also want to include
tag.

For example, given this HTML:

5条回答
  •  醉酒成梦
    2021-02-06 02:24

    If you use HAML you can solve html converting by putting html with 'raw' option, f.e.

          = raw @product.short_description
    

提交回复
热议问题