Reshape Retext




Plugin wrapper over Retext, an extensible system for analyzing and manipulating natural language.
Usage
``js
const fs = require('fs')
const reshape = require('reshape')
const retext = require('reshape-retext')
const emoji = require('retext-emoji')
const smartypants = require('retext-smartypants')
reshape({
plugins: retext([[emoji, { convert: 'encode' }], smartypants])
}).process(fs.readFileSync('path/to/file.html', 'utf8'))
.then((result) => { fs.writeFileSync('path/to/file.html', 'utf8') })
`
#### 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.
`
Skipping Tags
If you'd like to have retext skip processing any any particular tag, you can add a retext-skip attribute to the tag. The plugin will not process the tag's contents, but will remove the attribute in the output. For example, the following input:
`html
:tada:
:tada:
`
...would produce this output:
`html
🎉
:tada:
``
License & Contributing
- Licensed under MIT
- See our contributing guide