@vuepress/core 1.7.1 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,5 +50,6 @@ export function handleRedirectForCleanUrls (router) {
50
50
  }
51
51
 
52
52
  function isRouteExists (router, path) {
53
- return router.options.routes.filter(route => route.path.toLowerCase() === path.toLowerCase()).length > 0
53
+ const pathLower = path.toLowerCase()
54
+ return router.options.routes.some(route => route.path.toLowerCase() === pathLower)
54
55
  }
@@ -1,4 +1,5 @@
1
1
  import unionBy from 'lodash/unionBy'
2
+ import escape from 'escape-html'
2
3
 
3
4
  export default {
4
5
  // created will be called on both client and ssr
@@ -132,7 +133,7 @@ function renderPageMeta (meta) {
132
133
  return meta.map(m => {
133
134
  let res = `<meta`
134
135
  Object.keys(m).forEach(key => {
135
- res += ` ${key}="${m[key]}"`
136
+ res += ` ${key}="${escape(m[key])}"`
136
137
  })
137
138
  return res + `>`
138
139
  }).join('\n ')
@@ -1,5 +1,15 @@
1
1
  const { fs, path, chalk, logger } = require('@vuepress/shared-utils')
2
2
 
3
+ // Only empty the `.temp` directory at most once per run to avoid
4
+ // compilation errors caused by removed files.
5
+ // See: https://github.com/vuejs/vuepress/issues/2254#issuecomment-689457157
6
+ //
7
+ // Known issue: This can cause the `.temp` directory to grow while the server
8
+ // is running, but the impact is limited because the `.temp` directory will
9
+ // be cleared when restarting the server.
10
+ // See discussion in https://github.com/vuejs/vuepress/pull/2612
11
+ let alreadyEmptied = false
12
+
3
13
  /**
4
14
  * Create a dynamic temp utility context that allow to lanuch
5
15
  * multiple apps with isolated context at the same time.
@@ -19,8 +29,9 @@ module.exports = function createTemp (tempPath) {
19
29
 
20
30
  if (!fs.existsSync(tempPath)) {
21
31
  fs.ensureDirSync(tempPath)
22
- } else {
32
+ } else if (!alreadyEmptied) {
23
33
  fs.emptyDirSync(tempPath)
34
+ alreadyEmptied = true
24
35
  }
25
36
 
26
37
  logger.debug(`Temp directory: ${chalk.gray(tempPath)}`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/core",
3
- "version": "1.7.1",
3
+ "version": "1.8.3",
4
4
  "description": "Minimalistic doc generator with Vue component based layout system",
5
5
  "keywords": [
6
6
  "documentation",
@@ -25,11 +25,11 @@
25
25
  "dependencies": {
26
26
  "@babel/core": "^7.8.4",
27
27
  "@vue/babel-preset-app": "^4.1.2",
28
- "@vuepress/markdown": "1.7.1",
29
- "@vuepress/markdown-loader": "1.7.1",
30
- "@vuepress/plugin-last-updated": "1.7.1",
31
- "@vuepress/plugin-register-components": "1.7.1",
32
- "@vuepress/shared-utils": "1.7.1",
28
+ "@vuepress/markdown": "1.8.3",
29
+ "@vuepress/markdown-loader": "1.8.3",
30
+ "@vuepress/plugin-last-updated": "1.8.3",
31
+ "@vuepress/plugin-register-components": "1.8.3",
32
+ "@vuepress/shared-utils": "1.8.3",
33
33
  "autoprefixer": "^9.5.1",
34
34
  "babel-loader": "^8.0.4",
35
35
  "cache-loader": "^3.0.0",
@@ -74,5 +74,5 @@
74
74
  "email": "chl814@foxmail.com"
75
75
  }
76
76
  ],
77
- "gitHead": "3bf6a7b51f87d6329c330f1e65de0d020253a09f"
77
+ "gitHead": "469b33fc781edbc4dfd1b4dc56a71c76188a521f"
78
78
  }