-
Notifications
You must be signed in to change notification settings - Fork 134
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
Index []() style links #827
Conversation
onespaceman
commented
Mar 23, 2024
- style links
- No longer opens in new window if link is local
- Now indexed if local
- Page completion
- Changed on rename and refactor
- Refactor now uses link position from the index to change references
- New query for linked attachments
This is very nice! Let me have a closer look at this and do some testing. |
I've noticed that linking to other pages with the |
Another question is: should attachment links be tagged with |
Yeah, apparently the correct way to enclose the link with <> if it has whitespaces. It doesn't work right now, but I could add it and call it a day. I'm not a fan, but if the spec says this is how it must be, who am I to argue? |
Good point. another option is to combine with regular LinkObjects as a union
What do you think? |
Really? First time I heard of that notation. Markdown is a new surprise every day 😆 |
Actually yeah, that makes sense, let's do that. I suppose you can easily filter one or the other by filtering on either |
While I'm doing this I'm also adding in updating attachment links on rename/refactor (fixes #733)
|
As for 1. Right, so the semantics of links and image links should be that they’re relative, to be consistent with default markdown behavior. As for 2. I think that would be great actually. And making that the default drag & drop etc. behavior… good question. Maybe? As for 4. Option 2 would be the nicest I’d say |
Ok, this turned out to be pretty big, so I did a hard reset and tried to break it into digestible commits. Here is a basic space setup I used for testing how renaming works with rewriting links Also I had a really weird bug with importing regex constants. |
Ok let me give this a try. We clearly need an end-to-end style testing framework for SB for things like this 😆 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all: thanks so much for doing this work. The PR is pretty large and it's pretty hard to review, so have a look at the few things I mentioned and at the same time I'll do a local checkout and play with it to see if I can make it break.
Issue: When auto completing an image URL with a space in the name, it expands to a syntax with
which then breaks in the live preview (it shows the image as a broken link). I think this may just not be valid markdown at all, and may have to resort to a URL encoded URL? Update: funny thing is that with links to wiki pages this does work:
clicking that link works fine. |
Overall, once again: thanks for making this effort. It's looking really good, and we now will have code complete for attachments, which I'm pretty sure was missing until now. At some point SB may actually become decent for stuff that involves not primarily text files 😆 |
I think that covers those issues. let me know if anything else needs changing |
This looks almost good to go, just found one issue: You auto complete a page with |
Ok, it is inconsistent with the To be honest, I'd prefer to keep using |
Ok I think you indeed added the
|
That should fix the upload path. I'll fix merge conflicts later. |
Embeding page links is the next thing I'm working on. So if you don't mind it doing nothing for a little bit, I'll just leave it as is. |
Sure, that sounds great. Making the tansclosure editable is not a priority imo. Using it as a live template is also what I'd go for. |
pinging @fflorent for input as well |
Personally I have no strong preference. I don't know to what extent this is any way standardized. Incompatibility with other tools (maybe GitHub not sure of it even supports it) would be by only concern. |
It's not standardized at all. Obsidian uses the format I suggested, most of the rest, including github use html embeds. This way is probably better because links will still work as normal |
I'm perfectly fine with changing it then |
there. should be ready |
Ok this looks good and seems to work as expected Two questions remain:
|
yes to both. |
Alright. Let's do this! |
Thanks again. This is awesome stuff. |