javalent / fantasy-statblocks

Create Dungeons and Dragons style statblocks for Obsidian.md
MIT License
346 stars 72 forks source link

fix: Fix stringifier incorrectly matching some links #435

Closed miscoined closed 4 weeks ago

miscoined commented 2 months ago

Pull Request Description

The previous regex would match the following:

abilityMods: [4, 2, 3, -3, 1, -1]
resistances: "[Some Link](note.md)"

So that that the first group (the link text) would match:

4, 2, 3, -3, 1, -1]
resistances: "[Some Link

and the second group (the path) would match:

note.md

This commit changes the regex so that it doesn't falsely match in these cases and instead just matches the actual markdown link.

Changes Proposed

Checklist