Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noblesamurai/rehype-plaintext
Output plain text from rehype.
https://github.com/noblesamurai/rehype-plaintext
Last synced: about 1 month ago
JSON representation
Output plain text from rehype.
- Host: GitHub
- URL: https://github.com/noblesamurai/rehype-plaintext
- Owner: noblesamurai
- License: other
- Created: 2016-08-17T00:31:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-17T05:22:17.000Z (over 8 years ago)
- Last Synced: 2024-11-20T10:56:39.288Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 3
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rehype-plaintext
Output plain text from rehype.
[![build status](https://secure.travis-ci.org/noblesamurai/rehype-plaintext.png)](http://travis-ci.org/noblesamurai/rehype-plaintext)
## Installation
This module is installed via npm:
``` bash
$ npm install rehype-plaintext
```## Example Usage
``` js
var rehypePlaintext = require('rehype-plaintext'),
unified = require('unified'),
parseHTML = require('rehype-parse'),
expect = require('expect.js');unified()
.use(parseHTML)
.use(rehypePlaintext)
.process('Hi there my friend I hope you are well.
', function(err, result) {
expect(result.toString()).to.equal('Hi there my friend I hope you are well.');
});
```# Acknowledgements
With thanks to https://gist.github.com/blahah/bb8ee2c7695180f425f443f88fa16b79