Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Update #6

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "hexo",
"root": true
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
node_modules
node_modules/
.nyc_output/
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
language: node_js

cache:
npm: true

sudo: false

node_js:
- "8"
- "10"
- "node"

script:
- npm run eslint
- npm run test-cov

after_script:
- npm install coveralls
- nyc report --reporter=text-lcov | coveralls
9 changes: 6 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
var pangunode = require('pangunode');
'use strict';

hexo.extend.filter.register('after_post_render', function(data) {
/* global hexo */

const pangunode = require('pangunode');

hexo.extend.filter.register('after_post_render', data => {
data.title = pangunode(data.title);
data.content = pangunode(data.content);
});

28 changes: 20 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
"name": "hexo-filter-auto-spacing",
"version": "0.2.1",
"description": "Add spaces between CJK characters and western characters.",
"main": "index",
"repository": {
"type": "git",
"url": "https://github.com/hexojs/hexo-filter-auto-spacing.git"
"main": "index.js",
"files": [
"index.js"
],
"scripts": {
"eslint": "eslint .",
"test": "mocha test/index.js",
"test-cov": "nyc npm run test"
},
"repository": "hexojs/hexo-filter-auto-spacing",
"bugs": {
"url": "https://github.com/hexojs/hexo-filter-auto-spacing/issues"
},
Expand All @@ -16,11 +21,18 @@
"spacing"
],
"author": "Tommy Chen <tommy351@gmail.com> (http://zespia.tw)",
"license": {
"type": "MIT",
"url": "https://raw.github.com/tommy351/hexo/master/LICENSE"
},
"license": "MIT",
"dependencies": {
"pangunode": "^0.1.0"
},
"devDependencies": {
"chai": "^4.1.2",
"eslint": "^6.1.0",
"eslint-config-hexo": "^3.0.0",
"mocha": "^6.0.0",
"nyc": "^14.1.1"
},
"engines": {
"node": ">=8.6.0"
}
}
3 changes: 3 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "hexo/test"
}
10 changes: 10 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
'use strict';

const should = require('chai').should(); // eslint-disable-line

describe('hexo-filter-auto-spacing', () => {
// Tests.
it('should add space between CJK and Western characters', () => {
return true;
});
});