If the Section heading contains a wiki link instead of starting with a word boundary character after the heading #s, (e.g. "## [[Logbook]]") the areas that should be nested are all H1.
This is because the regex in getHeadingLevel requires \s\b (space followed by word boundary) to compute the number of #s at the front of the Section heading and getHeadingLevel("## [[Logbook]]") => null. I edited the main.js plugin file to remove \b locally and this plugin behaves as expected.
Oh, good catch! For some reason I was thinking \b matched all non-whitespace characters. I changed this to be \s+\S which should better match the markdown spec.
Describe the bug
If the Section heading contains a wiki link instead of starting with a word boundary character after the heading #s, (e.g. "## [[Logbook]]") the areas that should be nested are all H1.
This is because the regex in
getHeadingLevel
requires\s\b
(space followed by word boundary) to compute the number of #s at the front of the Section heading andgetHeadingLevel("## [[Logbook]]") => null
. I edited themain.js
plugin file to remove\b
locally and this plugin behaves as expected.I'd be happy to submit a pull request, but I see this regex was explicitly added here https://github.com/liamcain/obsidian-things-logbook/commit/b057ecf3cfb1757e7fc007111005c44c123928e3#diff-39b2554fd18da165b59a6351b1aafff3714e2a80c1435f2de9706355b4d32351R5
... and I assume there is some context I'm missing or some other use case that removing the \b might break.
Steps to reproduce
## [[Logbook]]
Things Logbook: Sync
from the command palletgetHeadingLevel("## [[Logbook]]") => null
Expected behavior
Areas should nest under the Section heading.
OS
macOS
Obsidian Version
v0.11.7
obsidian-things-logbook Version
0.1.8