Socket
Book a DemoInstallSign in
Socket

remark-fix-guillemets

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-fix-guillemets

This plugin fixes `typographic-plugin` when used together with `remark-parse`.

1.1.3
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source

remark-fix-guillemets Build Status Coverage Status

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-guillemets

Usage

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

MIT © Zeste de Savoir

Keywords

remark

FAQs

Package last updated on 27 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.