From 9ac240d6752f948fadc643a6c94e4ba5b9dbf8a9 Mon Sep 17 00:00:00 2001 From: Matthew Scott Date: Mon, 4 Sep 2023 12:42:33 -0700 Subject: [PATCH] Allow spaces in header portion of links (#181) * Allow spaces in header portion of links * fix changelog --------- Co-authored-by: epwalsh --- CHANGELOG.md | 4 ++++ lua/obsidian/command.lua | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 98d6a8c74..bb249375e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed + +- A but when following links when headers have a space. + ## [v1.13.0](https://github.com/epwalsh/obsidian.nvim/releases/tag/v1.13.0) - 2023-08-24 ### Added diff --git a/lua/obsidian/command.lua b/lua/obsidian/command.lua index 0d7d10a96..4ae44ef05 100644 --- a/lua/obsidian/command.lua +++ b/lua/obsidian/command.lua @@ -571,7 +571,7 @@ command.follow = function(client, _) end -- Remove header link from the end if there is one. - local header_link = note_file_name:match "#[%a%d-_]+$" + local header_link = note_file_name:match "#[%a%d -_]+$" if header_link ~= nil then note_file_name = note_file_name:sub(1, -header_link:len() - 1) end