1.1.3 • Published 2 years ago
remark-fix-guillemets v1.1.3
remark-fix-guillemets

This plugin fixes typographic-plugin when used together with remark-parse.
Motivation
When <<a>> is parsed by remark-parse the resulting tree is:
root[1] (1:1-1:6, 0-5)
└─ paragraph[3] (1:1-1:6, 0-5)
├─ text: "<" (1:1-1:2, 0-1)
├─ html: "<a>" (1:2-1:5, 1-4)
└─ text: ">" (1:5-1:6, 0-1)As you see here << got split into a text node < and an HTML node.
Since remark-textr only gets applied to 'text' nodes, << is not replaced by «.
This plugin replaces the previous tree with:
root[1] (1:1-1:6, 0-5)
└─ paragraph[1] (1:1-1:6, 0-5)
└─ text: "<<a>>" (1:1-1:6, 0-5)Install
npm:
npm install --save remark-fix-guillemetsUsage
Dependencies:
const unified = require('unified')
const remarkParse = require('remark-parse')
const stringify = require('rehype-stringify')
const remark2rehype = require('remark-rehype')
const remarkFixGuillemets = require('remark-fix-guillemets')Usage:
unified()
.use(remarkParse)
.use(remarkFixGuillemets)
.use(remark2rehype)
.use(stringify)License
1.1.3
2 years ago
1.1.2
3 years ago
1.1.1
5 years ago
1.1.0
6 years ago
1.0.20
6 years ago
1.0.19
7 years ago
1.0.18
7 years ago
1.0.17
7 years ago
1.0.16
7 years ago
1.0.15
7 years ago
1.0.14
7 years ago
1.0.13
7 years ago
1.0.12
8 years ago
1.0.11
8 years ago
1.0.10
8 years ago
1.0.9
8 years ago
1.0.8
8 years ago
1.0.7
8 years ago
1.0.6
8 years ago
1.0.5
8 years ago
1.0.4
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
0.0.5
8 years ago
0.0.4
9 years ago
0.0.3
9 years ago
0.0.2
9 years ago