Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions desktop/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import SearchBar from './components/SearchBar.vue';
import ThemeToggle from './components/ThemeToggle.vue';
import SettingsPanel from './components/SettingsPanel.vue';
import NotesHeader from './components/NotesHeader.vue';
import { TAG_REGEX } from './utils/regex';

// Configure marked options
marked.setOptions({
Expand Down Expand Up @@ -118,8 +119,7 @@ const loadNotes = async () => {

// Extract tags from note content (words starting with #)
const extractTags = (content: string): string[] => {
const tagRegex = /#(\w+)/g;
const matches = content.matchAll(tagRegex);
const matches = content.matchAll(TAG_REGEX);
return Array.from(matches, (m) => m[1].toLowerCase());
};

Expand Down Expand Up @@ -155,6 +155,7 @@ const filteredNotes = computed(() => {
filtered = filtered.filter((note) => {
const tags = extractTags(note.content);
// Check if note has ALL selected tags

return selectedTags.value.every((selectedTag) =>
tags.includes(selectedTag),
);
Expand Down
4 changes: 2 additions & 2 deletions desktop/src/components/TagsPanel.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue';
import Tag from './Tag.vue';
import { TAG_REGEX } from '../utils/regex';

interface Note {
id: number;
Expand All @@ -21,8 +22,7 @@ const emit = defineEmits<{

// Extract tags from note content (words starting with #)
const extractTags = (content: string): string[] => {
const tagRegex = /#(\w+)/g;
const matches = content.matchAll(tagRegex);
const matches = content.matchAll(TAG_REGEX);
return Array.from(matches, (m) => m[1].toLowerCase());
};

Expand Down
1 change: 1 addition & 0 deletions desktop/src/utils/regex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const TAG_REGEX = /(?<=\s|^)#([\w+-]+)/g;