Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: case insensitive keyword highlighting (#5965)

Liu Ji34b97c4cf775
diff --git a/frontend/src/views/sql-editor/AsidePanel/TreeNode/Label.vue b/frontend/src/views/sql-editor/AsidePanel/TreeNode/Label.vue
index 211dd90fef..f5faefe42a 100644
--- a/frontend/src/views/sql-editor/AsidePanel/TreeNode/Label.vue
+++ b/frontend/src/views/sql-editor/AsidePanel/TreeNode/Label.vue
@@ -9,7 +9,7 @@ import { useI18n } from "vue-i18n";
import { escape } from "lodash-es";
import { ConnectionAtom, DEFAULT_PROJECT_ID } from "@/types";
-import { getHighlightHTMLByKeyWords } from "@/utils";
+import { getHighlightHTMLByRegExp } from "@/utils";
const props = defineProps<{
atom: ConnectionAtom;
@@ -33,6 +33,10 @@ const text = computed(() => {
});
const html = computed(() => {
- return getHighlightHTMLByKeyWords(escape(text.value), escape(props.keyword));
+ return getHighlightHTMLByRegExp(
+ escape(text.value),
+ escape(props.keyword.trim()),
+ false /* !caseSensitive */
+ );
});
</script>