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

Add support for wiki links #62

Closed
rambip opened this issue Apr 27, 2023 · 3 comments
Closed

Add support for wiki links #62

rambip opened this issue Apr 27, 2023 · 3 comments

Comments

@rambip
Copy link

rambip commented Apr 27, 2023

First, I'm thankfull for this fantastic work !
I'm trying to build a web app to render markdown coming from obsidian or similar software, but there is one feature I'm missing: wikilinks.

It would be nice if I could get [[article_name|click here]] blocks in the abstract syntax tree, because it is quite common now in some tools that use markdown.

One potential challenge is that there is no "right answer" to create an html equivalent to this type of link, it depends on the situation.

Would that make sense to add wiki-style links as an option for the abstract syntax tree if there is no way to compile it ? Maybe creating a html link to ./article would be the best default to convert [[article]] ?

Thank's

@wooorm
Copy link
Owner

wooorm commented Apr 27, 2023

One more challenge: there is no spec. “Wiki links” work different in different spaces.
This is pretty important to me:

It is not a goal of this project to support lots of different extensions. It’s instead a goal to support very common and mostly standardized extensions.
https://github.com/wooorm/markdown-rs#extensions

As for precedence on things-in-the-ast-that-don’t-have-html-equivalents, MDX is already supported here, and directives are likely to be added at some point: #57.

@rambip
Copy link
Author

rambip commented Apr 27, 2023

Well, I think at least internal wikilinks are pretty standard: Either you use [[article_name|url or display]] or just [[article_name]]
But I agree, other kinds of links like interwiki are a mess.

But your're right, there is no spec for that kind of syntax, except the wikipedia one that is not markdown-based.

I will need to find a workaround, maybe replacing the wikilinks by real markdown-style links beforhand

@wooorm wooorm changed the title Support for wiki-style links Add support for wiki links Apr 29, 2023
@ChristianMurphy
Copy link
Collaborator

As a not standardized feature, I don't think this will land in core markdown-rs, closing this as not planned.

That said, if parser plugins become a thing #32 (comment), wikilinks could potentially be added as a community extension/plugin instead of a preprocessing step.

If you have interest in extending markdown-rs feel free to contribute to the plugin support efforts @rambip!

@ChristianMurphy ChristianMurphy closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2023
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

No branches or pull requests

3 participants