An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# PostHTML-Retext
[![npm version](https://badge.fury.io/js/posthtml-retext.svg)](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