Skip to content

Conversation

@oldmartijntje
Copy link

Adds #625.

With this change, you can select the width of an image like ![300](link) and ![alt text|300](link). This is a feature from obsidian syntax.

See below an image of the feature.

image

This is the markdown that was used to create this above example:

![64](https://docs.oldmartijntje.nl/000-Files/image/Temmie_Sprite.webp)

![TEMMIEEEE|64](https://docs.oldmartijntje.nl/000-Files/image/Temmie_Sprite.webp)

![32](https://docs.oldmartijntje.nl/000-Files/image/Temmie_Sprite.webp)

![TEMMIEEEE|32](https://docs.oldmartijntje.nl/000-Files/image/Temmie_Sprite.webp)

![TEMMIEEEE](https://docs.oldmartijntje.nl/000-Files/image/Temmie_Sprite.webp)

When a user does ![300](link) instead of ![alt text|300](link), the alt text of an image will be empty, cause it does not seem logical to keep the width as alt text.

See the dev-tools of the above example:

image

@github-actions
Copy link

github-actions bot commented Dec 6, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
quartz ✅ Ready (View Log) Visit Preview 43a0830

@aarnphm
Copy link
Collaborator

aarnphm commented Dec 6, 2025

@saberzero1 for the wikilink parser I have this implemented already, but for current Quartz we can also merge this one.

We should probably freeze development on v4 soon.

@saberzero1
Copy link
Collaborator

@saberzero1 for the wikilink parser I have this implemented already, but for current Quartz we can also merge this one.

We should probably freeze development on v4 soon.

Agreed.

@DeanLemans
Copy link

Also closes: #2160

@DeanLemans
Copy link

@saberzero1 for the wikilink parser I have this implemented already, but for current Quartz we can also merge this one.
We should probably freeze development on v4 soon.

Agreed.

V5 is in the works??
Can we test/use it?

if (numberMatch) {
const width = numberMatch[1]
node.properties.style = `width: ${width}px;`
node.properties.alt = "" // or should we keep the alt text the number?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep it like this, having a number as alt is kinda confusing especially accessibility-wise.

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.

5 participants