Skip to content

Commit 0cae480

Browse files
committed
search worker patch for mkdocs-material
1 parent 3486e0c commit 0cae480

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--- src/assets/javascripts/integrations/search/worker/_/index.ts 2022-11-11 18:49:20.000000000 +0100
2+
+++ "src/assets/javascripts/integrations/search/worker/_/index - encryptcontent.ts" 2022-11-13 20:24:57.313110700 +0100
3+
@@ -86,6 +86,19 @@
4+
suggestions: feature("search.suggest")
5+
}
6+
7+
+ /* Hack to enable search Index decryption */
8+
+ let sessionIndex = sessionStorage.getItem('encryptcontent-index')
9+
+ let saveIndex = {}
10+
+ if (!sessionIndex) {
11+
+ saveIndex['config'] = config
12+
+ saveIndex['docs'] = docs
13+
+ sessionStorage.setItem('encryptcontent-index', JSON.stringify(saveIndex))
14+
+ } else {
15+
+ saveIndex = JSON.parse(sessionIndex)
16+
+ config = saveIndex['config']
17+
+ docs = saveIndex['docs']
18+
+ }
19+
+
20+
/* Return search index after defaulting */
21+
return { config, docs, options }
22+
}

0 commit comments

Comments
 (0)