🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@distributorcentral/html-to-plaintext

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@distributorcentral/html-to-plaintext

Converts a block of HTML to plain text, correctly preserving newlines in tricky situations.

unpublished
latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

HTML to Plaintext

Converts HTML to plain text. Preserves line breaks well, but doesn't care about rendering bullet points, numbers, etc.

This is a port of a solution I found here: http://stackoverflow.com/a/30088920

How to use:

import getPlainText from 'html-to-plaintext`;

const plainText = getPlainText(document.getElementsByClassName('.editor')[0]);

To run the tests:

npm install
npm test

Keywords

convert

FAQs

Package last updated on 21 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts