obsidian-tidy-footnotes icon indicating copy to clipboard operation
obsidian-tidy-footnotes copied to clipboard

Fix regex - prohibit whitespaces in footnotes

Open davidkopp opened this issue 11 months ago • 0 comments

I had the problem that a footnote definition was recognized even though it wasn't one and therefore the entire algorithm no longer worked.

Example text:

The GHG Protocol[^1] is an internationally recognized standard for measuring and reporting greenhouse gas emissions, for entire companies or just for individual products. The emissions are divided into three scopes [[@WorldResourcesInstitute.2011.GHGScopeStandard]]:

The regex should only match the 1, but it matched everything until the colon:

1] is an internationally recognized standard for measuring and reporting greenhouse gas emissions, for entire companies or just for individual products. The emissions are divided into three scopes [[@WorldResourcesInstitute.2011.GHGScopeStandard]

This PR fixes that by allowing only footnote characters that are not whitespace.

davidkopp avatar Mar 13 '24 16:03 davidkopp