ejmg / zerm

a minimalist and dark theme for Zola
https://zerm.ejmg.now.sh/
MIT License
120 stars 39 forks source link

Inline code blocks: no white space breaks #48

Closed kartva closed 2 years ago

kartva commented 2 years ago

Inline code (`like so`) has white-space: normal set, which makes it break: like so

instead of carrying over to the next line. like so

ref: #46

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/ejmg/zerm/7ynq4jBgPhF9fGCKq6Sfff6Euq8M
✅ Preview: https://zerm-git-fork-desmondwillowbrook-inline-code-breaks-ejmg.vercel.app

ejmg commented 2 years ago

Hey, thanks for the patch and sorry for taking such a long time to respond.

My only question is when is this behavior actually occurring? As of now, the demo site doesn't demonstrate it except for when used inside of a narrow table column (look at the bottom row for "Inspectah Deck" here). Compare this to your patch (here) and it looks like a regression.

I don't have the time to find the behavior myself, but if you can show me when and how this line breaking triggers then we can work towards stopping it without breaking other stylings.

kartva commented 2 years ago

Hmm, you're right. I was aiming for something like - prioritize breaking surrounding text first and then code blocks if line still doesn't fit, but I'm afraid I don't have enough experience with CSS to know if that's even possible.

ejmg commented 2 years ago

prioritize breaking surrounding text first and then code blocks if line still doesn't fit

do you have an example of where this is done elsewhere? this sounds almost like font-setting proper, ie like LaTeX.

I'm afraid I don't have enough experience with CSS to know if that's even possible.

don't feel bad, a lot of us only touch CSS when we have to.

That said, it looks like CSS has an attribute for pre like text that still respects line breaking when necessary via pre-wrap. AFAICT, it'll keep any whitespace formatting within the snippet of code as provided and only wrap when required by space limitation, eg like the "Inspectah Deck" table entry I listed above.

Would this work towards your needs? We would have to do some minor research to make sure it doesn't cause weird behaviors elsewhere but it does seem like a reasonable way to provide line breaking for code formatted sections that aren't code blocks proper.

kartva commented 2 years ago

Unfortunately, pre-wrap doesn't work.

orci ultrices dolor, at vulputate neque nulla lacinia eros. `Sed id ligula quis
est convallis tempor.` Curabitur lacinia pulvinar nibh. Nam a sapien.

Instead of expected output:

orci ultrices dolor, at vulputate neque nulla lacinia eros.
`Sed id ligula quis est convallis tempor.` Curabitur lacinia pulvinar nibh. Nam a sapien.