Skip to content

Conversation

@FoxtrotFaux
Copy link

This issue is due to that newline characters not being included in the multiline snippet.

Simplified snippet logic and temporarily removed multiline snippets. Please see below.

This is what I have been using locally to make the Linked Mentions look more familiar as a user coming from Logseq.

I will readd multiline logic to this PR depending on what you think.

I feel that for most mentions, adding context lines arbitrarily makes the snippet visually noisy in most cases.

I have the following possibly unwelcome ideas to improve this. I am willing to add them to this PR or separate PRs if you are interested.

Style the context lines with a slightly darker text color or something similar to make the line with the link stand out more. Could hide the context lines behind some sort of caret.

Include the preceding outline parent (see below) while skipping any lines in between and maybe adding an elipsis to indicate the skipped lines.

- Parent
  - Child
  - Child with [[link]]
  - Child

Include some succeeding outline children for cases where the link is used as a title for those outline children like below

- [[link]]
  - Child
  - Child
  - Child

@zefhemel
Copy link
Collaborator

Awesome, thank you for doing this. It's been bugging me forever but never enough to actually act 😆

Small request is that you run make check on the repo, you'll see there's a typecheck error now (see failing tests in this PR also).

The improvements you suggest sound interesting, happy to have a look at them!

@FoxtrotFaux
Copy link
Author

Yup, this was very much thrown together. I used the wrong regex function as well. Can use match() instead of matchAll() since we're not using capture groups. Don't have to convert to an array that way as well.

I was expecting you were going to make me reimplement the feature in some way like in my examples.

Will submit the fixes to pass when I get off work. I should be able to set up a new PR for the 2 multiline cases as well.

I haven't looked at anything else, so not sure how I would go about changing the styling or adding a caret at the moment.

@FoxtrotFaux
Copy link
Author

FoxtrotFaux commented Nov 14, 2025

Ok that should be good. Ignore what I said about match vs matchAll. I've been doing this on mobile lol

Will get on that other PR

Edit: no, that wasn't good. I will no longer be doing PRs at work dinners on mobile 2 cocktails in. desktop only from now on.

@zefhemel
Copy link
Collaborator

Ok, I suppose I forgot to mention to also run make test to run unit tests, which now fail (because you changed the expected snippets). See build output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants