remark-arrow
v1.0.4
Published
A remark plugin to replace ASCII arrows with Unicode arrows
Readme
remark-arrow 
A remark plugin to replace ASCII arrows with Unicode arrows.
<--> ↔
<-- ←
--> →
<==> ⇔
<== ⇐
==> ⇒Example
import { remark } from "remark";
import remarkArrow from "remark-arrow";
const result = await remark()
.use(remarkArrow)
.process("A --> B");
console.log(result.toString());
// A → BPlugin order consideration
If you are using remark-smartypants or any other plugin that transforms dashes (eg. -- to –),
you must apply remark-arrow before those plugins.
This ensures that arrows like --> are correctly replaced before being altered by other transformations.
If you cannot control the plugin order,
you can set the enDash or emDash options to true to also replace arrows with en or em dashes.
Options
interface RemarkArrowOptions {
enDash?: boolean;
emDash?: boolean;
}enDash: Also replace arrows that use an en dash (–).emDash: Also replace arrows that use an em dash (—).
To import the options interface:
import { type RemarkArrowOptions } from "remark-arrow";