New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Auto Link Title #249
Add Auto Link Title #249
Conversation
|
https://github.com/zolrath/obsidian-auto-link-title/blob/987b49d94c38d05a71e9bfa352935ea8b86c3438/main.ts#L163 https://github.com/zolrath/obsidian-auto-link-title/blob/987b49d94c38d05a71e9bfa352935ea8b86c3438/main.ts#L164 https://github.com/zolrath/obsidian-auto-link-title/blob/987b49d94c38d05a71e9bfa352935ea8b86c3438/main.ts#L2 https://github.com/zolrath/obsidian-auto-link-title/blob/987b49d94c38d05a71e9bfa352935ea8b86c3438/main.ts#L110 |
|
@lishid Thank you very much for the review! Looking at the exposed Am I missing an alternately exposed method of doing this or should I switch this to |
|
Ah indeed it doesn't support markers. I guess if you don't want to try and support mobile that's fine. There are probably other ways to make placeholder links that you can replace easily later, such as using a unique random ID and searching for it after. |
|
Ok! I've made the changes aside from moving from |
|
I took a look at the way you're attempting to find the URL - I would highly recommend to use a regex on the line text instead of using the token information and findWordAt - the token information is tied to the CodeMirror 5 implementation and won't be available on Mobile and/or web, probably ever, because CodeMirror 6 uses a completely different parse & token system. I am also not sure if we will ever attempt to make Marker compatible with CodeMirror 6. It does have a concept of marker, but is mostly for internal uses and would need an actual view extension to use markers. Editor is meant to be a common API to unify CM5 and CM6 for the common things such as getting and setting selection, getting and replacing text, etc. It is not meant to include the full CM5's API for all the advanced use cases, most of which don't have an exact equivalent in CM6 anyway. In the end, it's up to you. Restricting your plugin for desktop use only is an ok solution too. |
|
Let me know if you want it merged it the current state. The code looks fine at this point |
|
I'm up for a merge at this point! |
[X] I am submitting a new Community Plugin
https://github.com/zolrath/obsidian-auto-link-title
Release Checklist
main.jsmanifest.jsonstyles.css(optional)v)idin mymanifest.jsonmatches theidin thecommunity-plugins.jsonfile.