mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix: html tags searching in history or saved queries, fixes #847
This commit is contained in:
@ -75,7 +75,7 @@
|
|||||||
<code
|
<code
|
||||||
class="cut-text"
|
class="cut-text"
|
||||||
:title="query.sql"
|
:title="query.sql"
|
||||||
v-html="highlight(highlightWord(query.sql), {html: true})"
|
v-html="highlight(query.sql, {html: true})"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="tile-bottom-content">
|
<div class="tile-bottom-content">
|
||||||
@ -210,17 +210,6 @@ const resizeResults = () => {
|
|||||||
const refreshScroller = () => resizeResults();
|
const refreshScroller = () => resizeResults();
|
||||||
const closeModal = () => emit('close');
|
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) => {
|
const onKey = (e: KeyboardEvent) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (e.key === 'Escape')
|
if (e.key === 'Escape')
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
v-if="note.type === 'query'"
|
v-if="note.type === 'query'"
|
||||||
ref="noteParagraph"
|
ref="noteParagraph"
|
||||||
class="tile-paragraph sql"
|
class="tile-paragraph sql"
|
||||||
v-html="highlight(highlightWord(note.note), {html: true})"
|
v-html="highlight(note.note, {html: true})"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
|
Reference in New Issue
Block a user