mirror of
https://github.com/Fabio286/antares.git
synced 2025-02-16 11:41:25 +01:00
fix: html tags searching in history or saved queries, fixes #847
This commit is contained in:
parent
72bacdeabf
commit
6cb21ff792
@ -75,7 +75,7 @@
|
||||
<code
|
||||
class="cut-text"
|
||||
:title="query.sql"
|
||||
v-html="highlight(highlightWord(query.sql), {html: true})"
|
||||
v-html="highlight(query.sql, {html: true})"
|
||||
/>
|
||||
</div>
|
||||
<div class="tile-bottom-content">
|
||||
@ -210,17 +210,6 @@ const resizeResults = () => {
|
||||
const refreshScroller = () => resizeResults();
|
||||
const closeModal = () => emit('close');
|
||||
|
||||
const highlightWord = (string: string) => {
|
||||
string = string.replaceAll('<', '<').replaceAll('>', '>');
|
||||
|
||||
if (searchTerm.value) {
|
||||
const regexp = new RegExp(`(${searchTerm.value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')})`, 'gi');
|
||||
return string.replace(regexp, '<span class="text-primary text-bold">$1</span>');
|
||||
}
|
||||
else
|
||||
return string;
|
||||
};
|
||||
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
e.stopPropagation();
|
||||
if (e.key === 'Escape')
|
||||
|
@ -32,7 +32,7 @@
|
||||
v-if="note.type === 'query'"
|
||||
ref="noteParagraph"
|
||||
class="tile-paragraph sql"
|
||||
v-html="highlight(highlightWord(note.note), {html: true})"
|
||||
v-html="highlight(note.note, {html: true})"
|
||||
/>
|
||||
<div
|
||||
v-else
|
||||
|
Loading…
x
Reference in New Issue
Block a user