https://github.com/backrunner/pangu.simple.js
Based on Vinta's pangu.js, using a different rules
https://github.com/backrunner/pangu.simple.js
Last synced: 2 months ago
JSON representation
Based on Vinta's pangu.js, using a different rules
- Host: GitHub
- URL: https://github.com/backrunner/pangu.simple.js
- Owner: backrunner
- License: other
- Created: 2020-02-05T14:10:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T12:38:33.000Z (over 3 years ago)
- Last Synced: 2025-09-25T19:27:07.245Z (9 months ago)
- Language: JavaScript
- Size: 10.6 MB
- Stars: 14
- Watchers: 1
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE
Awesome Lists containing this project
README
Based on Vinta's version, modified by BackRunner.
一个更加干净好用的 pangu.js
## 概述
原版的 pangu.js 对内容做了过度的转化,有的东西并不符合中国大陆开发者对文字排版的需要。
这个版本替换了核心 pangu.js 的核心代码,同时去除了一些不必要的转换,来满足开发者更常规化的排版需求。
## 修改
- 去除了对中间点的转换
- 去除了标点强制到 Full-width 的转换
- 替换原有正则为一套更加适合普通写作的新正则
- 重写测试代码
## 用法
### 使用 npm 引入
Step 1: 安装这个包
```bash
$ npm install pangu.simple
```
Step 2: 引入这个包
```js
import pangu from 'pangu.simple';
pangu.spacingText('为什么你们就不能加一个Space呢');
```
### CDN 引入
```html
```
### License
MIT
Copyright (c) 2020 - 2022 BackRunner (For modified parts)
Copyright (c) 2013 Vinta (For original parts)