Skip to content
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

Feature request: Render parent list items in markdown #13

Open
cakechaser opened this issue Aug 16, 2023 · 3 comments
Open

Feature request: Render parent list items in markdown #13

cakechaser opened this issue Aug 16, 2023 · 3 comments
Labels
good first issue Good for newcomers

Comments

@cakechaser
Copy link

cakechaser commented Aug 16, 2023

Really awesome plugin, great work!

Right now the parent list item is not rendered in "Linked mentions", as you can see on the screenshots below. Is is possible to render these items? (I would expect it to have the same formatting as in the original page).

image image
@ivan-lednev ivan-lednev added the good first issue Good for newcomers label Aug 18, 2023
@ivan-lednev
Copy link
Owner

Hello, @cakechaser,

This is certainly possible, but it might slow down the search and make it even more janky. Right now, most of the jank comes exactly from rendering markdown, imagine how performance would be impacted if we increased the amount of renders even further 😢

@cakechaser
Copy link
Author

@ivan-lednev, understood, thanks for the explanation!

I've forked the project to try to implement this feature, since I've seen the "good first issue" label.
But in case you feel like this will impact performance a lot, feel free to close, since it's of course not an essential feature, only "nice to have" :)

@ivan-lednev
Copy link
Owner

ivan-lednev commented Aug 22, 2023

@cakechaser, while feeding every breadcrumb to the markdown renderer is going to significantly slow things down, there are other things we could do:

  • Do what Obsidian does (e.g. inside its core 'Outline' plugin): strip away markdown tokens like ==, **. This is going to be very easy
    • mdast-util-to-string might be helpful
  • Replace the most common tokens with HTML tags manually (**bold** => <strong>bold</strong>). My guess is that it's not going to affect performance, while this kind of formatting is 90% of what you need from rendering breadcrumbs
  • Find a faster markdown compiler library and disable sanitizing

So I'll leave the issue open for now in case someone (maybe you 😅) will want to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants