vuepress-theme-uniapp-official 1.4.31 → 1.4.32

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.
@@ -160,11 +160,16 @@
160
160
  resultsScreen: { resultsText, noResultsText, askNoResultsText },
161
161
  },
162
162
  } = searchPageConfig;
163
+ const crawlerUrl = 'https://zh.uniapp.dcloud.io/'
163
164
 
164
- const resolveRoutePathFromUrl = (url, base = '/') =>
165
- url
165
+ const resolveRoutePathFromUrl = (url, base = '/') => {
166
+ if (url.indexOf(crawlerUrl) === 0) {
167
+ return url.replace(crawlerUrl, 'https://uniapp.dcloud.io/')
168
+ }
169
+ return url
166
170
  // remove url origin
167
- .replace(/^(https?:)?\/\/[^/]*/, '');
171
+ // .replace(/^(https?:)?\/\/[^/]*/, '');
172
+ }
168
173
 
169
174
  export default {
170
175
  name: 'DcloudSearchPage',
@@ -25,11 +25,18 @@ export function removeHighlightTags(hit) {
25
25
  if (!internalDocSearchHit.__docsearch_parent && !hit._highlightResult) {
26
26
  return hit.hierarchy.lvl0;
27
27
  }
28
+ const highlightResult = hit._highlightResult || {}
28
29
 
29
30
  const { value } =
30
- (internalDocSearchHit.__docsearch_parent
31
- ? ((internalDocSearchHit.__docsearch_parent._highlightResult || {}).hierarchy || {}).lvl0
32
- :((hit._highlightResult || {}).hierarchy || {}).lvl0) || {};
31
+ (
32
+ internalDocSearchHit.__docsearch_parent
33
+ ? ((internalDocSearchHit.__docsearch_parent._highlightResult || {}).hierarchy || {}).lvl0
34
+ :(
35
+ highlightResult.hierarchy
36
+ || (highlightResult.hierarchy_camel || [])[0]
37
+ || {}
38
+ ).lvl0
39
+ ) || {};
33
40
 
34
41
  let removeHighLightValue = value && regexHasHighlightTags.test(value)
35
42
  ? value.replace(regexHighlightTags, '')
@@ -49,4 +56,4 @@ export function isEditingContent(event) {
49
56
  tagName === 'SELECT' ||
50
57
  tagName === 'TEXTAREA'
51
58
  );
52
- }
59
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vuepress-theme-uniapp-official",
3
- "version": "1.4.31",
3
+ "version": "1.4.32",
4
4
  "description": "uni-app official website theme for vuepress",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -27,12 +27,6 @@
27
27
  "enhanceApp.js",
28
28
  "index.js"
29
29
  ],
30
- "scripts": {
31
- "publish:patch": "npm version patch && npm publish",
32
- "publish:minor": "npm version minor && npm publish",
33
- "publish:major": "npm version major && npm publish",
34
- "postpublish": "cnpm sync vuepress-theme-uniapp-official"
35
- },
36
30
  "dependencies": {
37
31
  "@docsearch/css": "^3.6.0",
38
32
  "@vuepress/plugin-back-to-top": "^1.9.5",
@@ -42,11 +36,16 @@
42
36
  "markdown-it-raw-table": "^1.0.0",
43
37
  "markdown-it-task-lists": "^2.1.1",
44
38
  "qr-code-with-logo": "^1.1.0",
45
- "vuepress-plugin-check-md2": "^1.0.5",
46
- "vuepress-plugin-expandable-row": "^1.0.9",
47
39
  "vuepress-plugin-juejin-style-copy": "^1.0.4",
48
40
  "vuepress-plugin-mermaidjs": "1.9.1",
49
41
  "vuepress-plugin-named-chunks": "^1.1.4",
50
- "vuepress-plugin-zooming": "^1.1.8"
42
+ "vuepress-plugin-zooming": "^1.1.8",
43
+ "vuepress-plugin-check-md2": "^1.0.5",
44
+ "vuepress-plugin-expandable-row": "^1.0.9"
45
+ },
46
+ "scripts": {
47
+ "publish:patch": "npm version patch && npm publish",
48
+ "publish:minor": "npm version minor && npm publish",
49
+ "publish:major": "npm version major && npm publish"
51
50
  }
52
- }
51
+ }