html-to-pure-text
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

html2plaintext

Convert html-formatted text to plaintext

  • strip tags
  • reformat ordered/unordered lists
  • treat whitespace like a browser
  • decode html entities
  • parses img to [image]/[图片]

Use

var h2p = require('html2plaintext')

h2p('<p>Hello,\n   &amp; <em>how  are <a href="https://me.com">you</a>?</em></p>')
// => "Hello, & how are you?"

Install

npm install html2plaintext

Test

npm install
npm test

参考项目

https://github.com/kurttheviking/html2plaintext

/html-to-pure-text/

    Package Sidebar

    Install

    npm i html-to-pure-text

    Weekly Downloads

    2

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    9.81 kB

    Total Files

    7

    Last publish

    Collaborators

    • zhangbobo