Skip to content

Commit

Permalink
Merge pull request #4 from CatcheSearch/dev
Browse files Browse the repository at this point in the history
Fix html parsing
  • Loading branch information
greentfrapp authored Apr 3, 2022
2 parents 61636d8 + 06858a2 commit 755943d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/vendor.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/components/SearchMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<script lang="ts">
import { defineComponent } from 'vue'
import { escapeHtml } from "@vue/shared"
import Minisearch, { SearchResult } from 'minisearch'
import { initSearch, highlightMatch } from '../utils/search'
import SearchBox from './SearchBox.vue'
Expand Down Expand Up @@ -108,8 +109,8 @@ export default defineComponent({
.map((result:SearchResult) => {
return {
url: result.url || '',
title: highlightMatch(this.query, result.title).highlight || '',
text: highlightMatch(this.query, result.text, 3, 10).highlight || '',
title: highlightMatch(this.query, escapeHtml(result.title)).highlight || '',
text: highlightMatch(this.query, escapeHtml(result.text), 3, 10).highlight || '',
}
})
this.updateDebounce(performance.now() - startSearchTime)
Expand Down
Loading

0 comments on commit 755943d

Please sign in to comment.