Skip to content

Commit 400c37d

Browse files
committed
upgrade markdown-it
1 parent 5fb4a00 commit 400c37d

File tree

9 files changed

+1122
-1010
lines changed

9 files changed

+1122
-1010
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"lint-staged": {
2121
"*.{js,ts}": [
22-
"lerna run lint:fix",
22+
"eslint --fix",
2323
"git add"
2424
]
2525
},

packages/example/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
"version": "0.1.4",
44
"private": true,
55
"scripts": {
6-
"dev": "yarn webpack-dev-server --config webpack.config.js",
7-
"lint": "eslint --ext .js,.ts src",
8-
"lint:fix": "yarn run lint --fix"
6+
"dev": "yarn webpack-dev-server --config webpack.config.js --open",
7+
"lint": "eslint --ext .js,.ts src"
98
},
109
"dependencies": {
1110
"github-markdown-css": "^3.0.1",

packages/example/src/example.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
@import "~github-markdown-css/github-markdown.css";
2+
@import "~prism-themes/themes/prism-atom-dark.css";
3+
14
html,
25
body {
36
padding: 0;
@@ -13,9 +16,6 @@ body {
1316
box-shadow: 0 10px 10px rgba(0, 0, 0, 0.225)
1417
}
1518

16-
@import "~github-markdown-css/github-markdown.css";
17-
@import "~prism-themes/themes/prism-atom-dark.css";
18-
1919
div[class*="language-"] {
2020
position: relative;
2121
z-index: 100;

packages/vue-markdown-loader/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[简体中文](./README-CN.md)
44

5-
This is a webpack laoder that can load markdown file. With proper configuration, the loader can convert markdown file content into `vue sfc` component object or into html string, so it can be chained with vue-loader or html-loader.
5+
This is a webpack loader that can load markdown files. With proper configuration, the loader can convert markdown file content into `vue sfc` component object or into html string, so it can be chained with vue-loader or html-loader.
66

77
The project is inspired by [vuepress](https://github.com/vuejs/vuepress), we reused most of its source code and made some improvements to allow it being used in non-vuepress project.
88

@@ -16,9 +16,9 @@ If you are interested in Vuepress, please visit [vuepress](https://github.com/vu
1616
npm i @tianyong90/vue-markdown-loader -S
1717
```
1818

19-
## Useage
19+
## Usage
2020

21-
### sue along with vue-loader
21+
### Use along with vue-loader
2222

2323
Generally, it is recommended to be used with `vue-loader`
2424

@@ -80,7 +80,7 @@ export default {
8080
</style>
8181
```
8282
83-
### along with html-loader
83+
### Use along with html-loader
8484
8585
`vue-markdown-loader` can parse markdown and return html string which can be loaded by `html-loader`
8686
@@ -126,13 +126,13 @@ Hello:
126126
127127
![加载后的 html](./images/md-html-string.png)
128128
129-
### use it alone
129+
### Use it alone
130130
131-
`vue-markdown-loader` can parse markdown file and return an object whick contains hteml and frontmattter data of the file.
131+
`vue-markdown-loader` can parse markdown file and return an object which contains html and frontmattter data of the file.
132132
133133
1. configuration
134134
135-
add rule for .md file in webpack.config.js
135+
add rule for `.md` file in webpack.config.js
136136
137137
```js
138138
module: {
@@ -166,7 +166,7 @@ import Hello from 'hello.md'
166166
console.log(Hello)
167167
```
168168
169-
the variable `Html` contains 2 property, `attributes`(frontmatter data) and `html`(html content), looks lick below:
169+
the variable `Html` contains 2 property, `attributes`(frontmatter data) and `html`(html content), looks like below:
170170
171171
![加载后的对象](./images/md-raw-object.png)
172172

packages/vue-markdown-loader/jest.config.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module.exports = {
22
preset: 'ts-jest',
33
testEnvironment: 'node',
44
blobals: {
5-
'ts-jest': {
6-
7-
}
8-
}
9-
};
5+
'ts-jest': {},
6+
},
7+
}

packages/vue-markdown-loader/package.json

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@
33
"version": "0.1.4",
44
"description": "A simple webpack loader that transform markdown file to vue compoennt.",
55
"keywords": [
6-
"vue loader",
7-
"markdown-loader"
6+
"markdown-loader",
7+
"vue loader"
88
],
9-
"main": "lib/index.js",
10-
"files": [
11-
"lib"
12-
],
13-
"author": "tianyong90 <412039588@qq.com>",
149
"repository": {
1510
"type": "git",
1611
"url": "https://github.com/tianyong90/vue-markdown-loader.git"
1712
},
1813
"license": "MIT",
14+
"author": "tianyong90 <412039588@qq.com>",
15+
"files": [
16+
"lib"
17+
],
18+
"main": "lib/index.js",
1919
"scripts": {
20-
"dev": "yarn tsc --watch",
2120
"build": "yarn tsc",
21+
"dev": "yarn tsc --watch",
22+
"lint": "eslint --ext .js,.ts src test",
23+
"lint:fix": "yarn run lint --fix",
2224
"release": "node build/release.js",
23-
"test": "jest --config=jest.config.js",
24-
"lint": "eslint --ext .js,.ts src",
25-
"lint:fix": "yarn run lint --fix"
25+
"test": "jest --config=jest.config.js"
2626
},
2727
"dependencies": {
2828
"chalk": "^2.4.2",
@@ -33,7 +33,7 @@
3333
"highlight.js": "^9.15.6",
3434
"loader-utils": "^1.2.3",
3535
"lru-cache": "^5.1.1",
36-
"markdown-it": "^9.0.0",
36+
"markdown-it": "^10.0.0",
3737
"markdown-it-anchor": "^5.0.2",
3838
"markdown-it-chain": "^1.3.0",
3939
"markdown-it-container": "^2.0.0",
@@ -62,9 +62,7 @@
6262
"eslint-plugin-prettier": "^3.0.1",
6363
"eslint-plugin-promise": "^4.0.0",
6464
"eslint-plugin-standard": "^4.0.0",
65-
"execa": "^2.0.3",
6665
"jest": "^24.7.1",
67-
"listr": "^0.14.1",
6866
"nodemon": "^1.19.1",
6967
"prettier": "^1.14.3",
7068
"ts-jest": "^24.0.2",

packages/vue-markdown-loader/test/jest.config.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ module.exports = {
55
transform: {
66
'^.+\\.tsx?$': 'ts-jest',
77
},
8-
testMatch: [
9-
"<rootDir>/test/tests/*.test.ts"
10-
],
8+
testMatch: ['<rootDir>/test/tests/*.test.ts'],
119
coverageDirectory: '<rootDir>/test/coverage',
12-
moduleFileExtensions: [
13-
'ts',
14-
'tsx',
15-
'js'
16-
],
10+
moduleFileExtensions: ['ts', 'tsx', 'js'],
1711
}
Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
module.exports = {
2-
"roots": [
3-
"<rootDir>/src"
4-
],
5-
"transform": {
6-
"^.+\\.tsx?$": "ts-jest"
2+
roots: ['<rootDir>/src'],
3+
transform: {
4+
'^.+\\.tsx?$': 'ts-jest',
75
},
8-
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
9-
"moduleFileExtensions": [
10-
"ts",
11-
"tsx",
12-
"js",
13-
"jsx",
14-
"json",
15-
"node"
16-
],
6+
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
7+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
178
}

0 commit comments

Comments
 (0)