zolrath / obsidian-auto-link-title

Automatically fetch the titles of pasted links
MIT License
443 stars 62 forks source link

Escape special characters in URLs when title isn't parsed #40

Closed Sanqui closed 9 months ago

Sanqui commented 2 years ago

When pasting a URL like https://twitter.com/_underscore, the plugin substitutes [https://twitter.com/_underscore](https://twitter.com/_underscore). The problem is Obisdian interprets the underscore as a Markdown character and renders the latter half of the link as italic. The plugin should escape characters like _ and * when putting raw URLs into titles.

bugal commented 2 years ago

And also square brackets.

wyne commented 2 years ago

I think an easy fix would be to use <a href="LINK">TITLE</a> instead of [TITLE](LINK) format. Example: https://github.com/zolrath/obsidian-auto-link-title/pull/53

addshore commented 1 year ago

Escaping could generally be improved I think Using the following link https://stackoverflow.com/questions/67379247/error-node-modules-types-jasmine-index-d-ts66815-error-ts2430-interface Results in the following markdown image

[angular - Error: node\_modules/@types/jasmine/index.d.ts:668:15 - error TS2430: Interface 'FunctionMatchers<Fn>' incorrectly extends interface 'Matchers<any>' - Stack Overflow](https://stackoverflow.com/questions/67379247/error-node-modules-types-jasmine-index-d-ts66815-error-ts2430-interface)
zolrath commented 9 months ago

This should be handled now! If there are any missing characters that should be escaped please let me know in another issue. Thanks!