jackyzha0 / quartz

🌱 a fast, batteries-included static-site generator that transforms Markdown content into fully functional websites
https://quartz.jzhao.xyz
MIT License
6.9k stars 2.48k forks source link

Inline image increases line height #1430

Open y9san9 opened 2 weeks ago

y9san9 commented 2 weeks ago

Describe the bug

I have an image with size 16x16 which is the same as I expect text to be. Using the following code I get two different results in Obsidian and in the deployment.

![[telegram_16x16.png]] **Telegram**: [@y9san9](https://t.me/y9san9)

Renders in Obsidian as:

Screenshot 2024-09-23 at 18 41 11

While after deploy it looks like this:

Screenshot 2024-09-23 at 18 40 22

Expected behavior

Line height is not changed my images that has lesser height than the line.

saberzero1 commented 2 weeks ago

img tags have a default margin on the top and bottom

https://github.com/jackyzha0/quartz/blob/9cefcd0dd1a503c727c8bbb2deb1b631329b3a42/quartz/styles/base.scss#L475-L479

if you want to override the img margins, you can do so in custom.scss.

For example, assuming every image you want without margins is named something like *16x16*, you could do something like below:

img[src*="16x16"] {
  margin: 0 0;
}
y9san9 commented 2 weeks ago

But in Obsidian itself inline images doesn't have padding