javalent / fantasy-statblocks

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

🐞 Wikilinks to websites are treated as vault links #281

Closed SondreElg closed 10 months ago

SondreElg commented 11 months ago

Check for existing bug reports before submitting.

Expected Behavior

When adding a wikilink to an external website in the description of a trait, clicking the rendered link should open the linked website in my browser.

Current behaviour

Rendered wikilink is treated as a vault link, attempting to open a file instead of a website, causing the operation to error.

Reproduction

  1. Create a note with the following content (replacing ~ with ` if needed)
    
    ---
    statblock: true
    name: "Example Statblock"
    traits:
    - name: Example
    desc: "A link to [example.com](https://example.com/)"
    ---
monster: "Example Statblock"


2. Click the example.com link rendered in the statblock.

3. Receive error `File name cannot contain any of the following characters: * " \ / < > : | ?`

### Which Operating Systems are you using?

- [ ] Android
- [ ] iPhone/iPad
- [ ] Linux
- [ ] macOS
- [X] Windows

### Obsidian Version Check

1.4.13

### Plugin Version

3.12.2

### Confirmation

- [X] I have disabled all other plugins and the issue still persists.

### Possible solution

Wrap corresponding code in a try-catch first attempting to open link as a vault link, then as an external link.
valentine195 commented 10 months ago

This should be fixed in 3.15.8