https://github.com/posthtml/posthtml-retext
PostHTML Retext plugin
https://github.com/posthtml/posthtml-retext
Last synced: 7 months ago
JSON representation
PostHTML Retext plugin
- Host: GitHub
- URL: https://github.com/posthtml/posthtml-retext
- Owner: posthtml
- Created: 2015-10-09T23:35:59.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-10T12:26:43.000Z (over 10 years ago)
- Last Synced: 2025-06-14T00:29:26.231Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 137 KB
- Stars: 17
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PostHTML-Retext
[](http://badge.fury.io/js/posthtml-retext)
[PostHTML](http://github.com/posthtml/posthtml) plugin wrapper over [Retext](https://github.com/wooorm/retext) extensible system for analysing and manipulating natural language
## Usage
```js
var fs = require('fs'),
posthtml = require('posthtml'),
html = fs.readFileSync('path/to/file.html');
posthtml()
.use(require('posthtml-retext')([
[require('retext-emoji'), { convert: 'encode' }], // Array if plugin has options
require('retext-smartypants')
]))
.process(html)
.then(function(result) {
fs.writeFileSync('path/to/file.html');
})
```
#### Input html
```html
Hello "world"...
The three wise monkeys [. . .] sometimes called the three mystic
apes--are a pictorial maxim. Together they embody the proverbial
principle to ("see no evil, hear no evil, speak no evil"). The
three monkeys are Mizaru (:see_no_evil:), covering his eyes, who
sees no evil; Kikazaru (:hear_no_evil:), covering his ears, who
hears no evil; and Iwazaru (:speak_no_evil:), covering his mouth,
who speaks no evil.
```
#### Output html
```html
Hello “world”…
The three wise monkeys […] sometimes called the three mystic
apes—are a pictorial maxim. Together they embody the proverbial
principle to (“see no evil, hear no evil, speak no evil”). The
three monkeys are Mizaru (🙈), covering his eyes, who
sees no evil; Kikazaru (🙉), covering his ears, who
hears no evil; and Iwazaru (🙊), covering his mouth,
who speaks no evil.
```
## License
MIT