1
1
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:
Fabio Di Stasio 2024-08-05 18:03:10 +02:00
parent 72bacdeabf
commit 6cb21ff792
2 changed files with 2 additions and 13 deletions

View File

@ -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('<', '&lt;').replaceAll('>', '&gt;');
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')

View File

@ -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