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

Allow wikilinks for image embedding #449

Open
0atman opened this issue Feb 12, 2025 · 3 comments
Open

Allow wikilinks for image embedding #449

0atman opened this issue Feb 12, 2025 · 3 comments

Comments

@0atman
Copy link

0atman commented Feb 12, 2025

(discussion started in #448, where wikilink support was added)

✅ Markdown links can embed images:

![image:width:20%](fido.jpg)

❌ But wikilinks do not yet support this:

![[fido.jpg|image:width:20%]]

Prior Art

A very related project is the Advanced Slides plugin for Obsidian (750k downloads), which handles image embedding and resizing like this:

Insert image with obsidian markdown syntax

![[Image.jpg]]

---

Scale image to a width of 100 px

![[Image.jpg|100]]
![Image|100](https://picsum.photos/id/1006/500/300)

I propose if possible, compatibility with this syntax would be a great option (if not default).

Thoughts

While comrak does have a wikilink extension, it doesn't appear to support embedding those links. it is notable that there are no examples of ![[]] links in their test suite.

Notes

@mfontanini mfontanini pinned this issue Feb 12, 2025
@mfontanini
Copy link
Owner

Like I mentioned in the other issue, I think this should be comrak's responsibility. It doesn't make sense that presenterm has to parse an already parsed markdown even further, plus comrak already should have the tools/primitives to parse this. I would imagine doing this work in comrak would yield the same Image node type they emit for the normal ![]() image tags so it would work here without any changes.

@0atman
Copy link
Author

0atman commented Feb 13, 2025

Totally agreed, I'll use this issue to track my progress over there 👌

@0atman
Copy link
Author

0atman commented Feb 13, 2025

tracking upstream issue kivikakk/comrak#535

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

2 participants