on master help sign in
add in cleanEntry function
commit4e103fa24db0bb0f061f5f5935620dfb3fa1bbd4 authorckipp01 <ckipp@pm.me> dateTue 13 Aug 2019, 16:28 (7 years ago) parentf535c4f
1 file changed+11−1
scripts/wiki.js+11−1
scripts/wiki.js+11−1
@@ -9,7 +9,17 @@ const Wiki = sites => {
99 const authors = new Set()
1010 const terms = new Set()
1111
12− const storeEntry = (author, url, category, term, entry) => {
12+ const cleanEntry = entry => {
13+ const temp = document.createElement('div')
14+ temp.textContent = entry
15+ return temp.innerHTML
16+ }
17+
18+ const storeEntry = (author, url, category, term, unCleanEntry) => {
19+ const entry = Array.isArray(unCleanEntry)
20+ ? unCleanEntry.map(x => cleanEntry(x))
21+ : cleanEntry(unCleanEntry)
22+
1323 if (!(category in entries)) {
1424 entries[category] = {}
1525 entries[category][term] = [{ entry, authors: [{ author, url }] }]