Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits and symbols).
如果你跟我一樣,每次看到網頁上的中文字和英文、數字、符號擠在一塊,就會坐立難安,忍不住想在它們之間加個空格。這個外掛(支援 Chrome 和 Firefox)正是你在網路世界走跳所需要的東西,它會自動替你在網頁中所有的中文字和半形的英文、數字、符號之間插入空白。
漢學家稱這個空白字元為「盤古之白」,因為它劈開了全形字和半形字之間的混沌。另有研究顯示,打字的時候不喜歡在中文和英文之間加空格的人,感情路都走得很辛苦,有七成的比例會在 34 歲的時候跟自己不愛的人結婚,而其餘三成的人最後只能把遺產留給自己的貓。畢竟愛情跟書寫都需要適時地留白。
與大家共勉之。
$ npm install pangu --save
<head>
// Files are located on /node_modules/pangu/dist/browser/
<script src="pangu.min.js"></script>
</head>
<script>
var newText = pangu.spacing("Mr.龍島主道:「Let's Party!各位高明博雅君子!」");
// output: "Mr. 龍島主道:「Let's Party! 各位高明博雅君子!」"
pangu.spacingPage();
pangu.spacingElementById('main');
pangu.spacingElementByClassName('comment');
pangu.spacingElementByTagName('p');
</script>
pangu.js
is also available on cdnjs:
<script src="https://cdnjs.cloudflare.com/ajax/libs/pangu/3.0.0/pangu.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pangu/3.0.0/pangu.min.js"></script>
var pangu = require('pangu'); // ES5
import pangu from 'pangu'; // ES6
pangu.spacing('Sephiroth見他這等神情,也是悚然一驚:不知我這Ultimate Destructive Magic是否對付得了?');
// output: Sephiroth 見他這等神情, 也是悚然一驚: 不知我這 Ultimate Destructive Magic 是否對付得了?
//./text.txt
// 聖誕老人Hohoho三小
pangu.spacingFile('./text.txt', function(err, result) {
// result = 聖誕老人 Hohoho 三小
});
pangu.spacingFilePromise('./text.txt').then(function(result) {
// result = 聖誕老人 Hohoho 三小
});
const result = pangu.spacingFileSync('./text.txt');
// result = 聖誕老人 Hohoho 三小
You need to install Node.js.
$ git clone git@github.com:vinta/pangu.js.git
$ cd pangu.js
$ npm install
$ npm run test
Released under the MIT License.
FAQs
Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (alphabetical letters, numerical digits and symbols).
The npm package pangu receives a total of 51,405 weekly downloads. As such, pangu popularity was classified as popular.
We found that pangu demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.