Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vincentbel/remark-pangu
给 Markdown 中英文自动插入空格的 remark 插件
https://github.com/vincentbel/remark-pangu
pangu remark remark-plugin text-spacing
Last synced: 4 days ago
JSON representation
给 Markdown 中英文自动插入空格的 remark 插件
- Host: GitHub
- URL: https://github.com/vincentbel/remark-pangu
- Owner: vincentbel
- License: mit
- Created: 2017-09-08T15:28:26.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-25T14:45:53.000Z (about 4 years ago)
- Last Synced: 2024-11-10T02:34:46.581Z (6 days ago)
- Topics: pangu, remark, remark-plugin, text-spacing
- Language: JavaScript
- Homepage:
- Size: 202 KB
- Stars: 30
- Watchers: 3
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# remark-pangu
[![travis build](https://img.shields.io/travis/VincentBel/remark-pangu.svg?style=flat-square)](https://travis-ci.org/VincentBel/remark-pangu)
[![version](https://img.shields.io/npm/v/remark-pangu.svg?style=flat-square)](http://npm.im/remark-pangu)
[![MIT License](https://img.shields.io/npm/l/remark-pangu.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)给 Markdown 中英文自动插入空格的 [remark](https://github.com/wooorm/remark) 插件(使用 [pangu.js](https://github.com/vinta/pangu.js))。
## Install
```bash
npm install remark-pangu
```## Usage
```js
remark().use(pangu)
``````js
const remark = require('remark')
const pangu = require('remark-pangu')const doc = '中文abc中文';
remark().use(pangu).process(doc, (err, file) => {
console.log(String(file));
});
// => 中文 abc 中文
```### Options
可以通过设置 options 控制是否处理不同类型的 Markdown 节点。
例如,此插件默认不处理 `inline code`,可以设置 `inlineCode: true` 开启处理:
```js
remark().use(pangu, {
inlineCode: true
})
```#### Default Options
```js
{
text: true,
inlineCode: false,
link: true,
image: true,
imageReference: true,
definition: true,
}
```## LICENSE
[MIT](./LICENSE)