remark-copywriting-correct

Remark plugin with copywriting-correct.js

Usage no npm install needed!

<script type="module">
  import remarkCopywritingCorrect from 'https://cdn.skypack.dev/remark-copywriting-correct';
</script>

README

remark-copywriting-correct

version MIT License

给 Markdown 中英文自动插入空格的 remark 插件(使用 https://github.com/rikakomoe/copywriting-correct)。

Install

npm install remark-copywriting-correct
npm install remark-math-space
# remark-math-space 用来在行内公式两侧加空格

Usage

"use strict";
var remark = require("remark");
var parse = require("remark-parse");
var math = require("remark-math");
var ww = require("remark-copywriting-correct");
var sp = require("remark-math-space");

var fs = require("fs");
var www = fs.readFileSync("a.md");

const doc = "中文abc中文$a_i$中文";
remark()
  .use(parse)
  .use(math)
  .use(ww)
  .use(sp)
  .process(doc, function(err, res) {
    console.log(String(res));
  });
// => 中文 abc 中文 $a_i$ 中文

LICENSE

MIT