It also occurred in regular links
Steps to reproduce
Enter [some link with title](http://127.0.0.1:8080/1/2/3 "hello world") in edit mode
Expected result
cmd/ctrl + click on url part of link (http://127.0.0.1:8080/1/2/3) in edit mode should open http://127.0.0.1:8080/1/2/3
Actual result
Seems that http://127.0.0.1:8080/1/2/3 "hello world" is opened
can be reproduced in both Live Preview and traditional cm5 editor
In local http server listening at 8080, the server recieved the followings:
Available on:
http://127.0.0.1:8080
http://172.24.108.142:8080
Hit CTRL-C to stop the server
[2021-11-22T02:48:38.726Z] "GET /1/2/3%20%22hello%20world%22" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15"
[2021-11-22T02:48:38.728Z] "GET /1/2/3%20%22hello%20world%22" Error (404): "Not found"
Environment
- Operating system: macOS 12.0.1 (21A559)
- Obsidian version: v0.13.4
Proposed solution
It seems that MarkdownView.triggerClickableToken is using all the text inside .cm-string.cm-url.cm-list-1 generated from Editor.getClickableTokenAt to open link:
I think that a gatekeeper that remove title part before URL being opened in click handler could be a workaround before the editor markdown parser is fixed:
window.open(e.text.replace(/(?<url>[^ ]+) +"(?:.+)" */,"$1"));