HTML to Plain Text with Ruby?

后端 未结 9 2035
无人共我
无人共我 2020-12-15 18:03

Is there anything out there to convert html to plain text (maybe a nokogiri script)? Something that would keep the line breaks, but that\'s about it.

If I write som

9条回答
  •  南笙
    南笙 (楼主)
    2020-12-15 18:40

    You want hpricot_scrub:

    http://github.com/UnderpantsGnome/hpricot_scrub

    You can specify which tags to strip / keep in a config hash.

提交回复
热议问题