Skip to content

Commit

Permalink
✨ Update regex for obsidian tags to prevent URLs from getting matched
Browse files Browse the repository at this point in the history
  • Loading branch information
chanjunren committed Jan 16, 2025
1 parent 1ae568c commit 6e09d54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// export const OBSIDIAN_TAG_REGEX = /#\S+/g;
export const OBSIDIAN_TAG_REGEX = /#([^\s#]+)/g;
// export const OBSIDIAN_TAG_REGEX = /#([^\s#]+)/g;
export const OBSIDIAN_TAG_REGEX = /(?<![^\s])#([^\s#]+)/g;

export const OBSIDIAN_INTERNAL_LINK_REGEX = /(?<!!)\[\[.*?\]\]/g;

Expand Down

0 comments on commit 6e09d54

Please sign in to comment.