joeroe / risotto

A minimalist, responsive hugo theme inspired by terminal ricing aesthetics.
https://risotto.joeroe.io
MIT License
393 stars 109 forks source link

Long lines in code blocks with line numbers overflow container #41

Closed Vinfall closed 1 year ago

Vinfall commented 1 year ago

Hugo version

I can reproduce this on latest Hugo v0.105.0. I install the extended version and it comes from Void Linux package, you can get the src template here.

Update: still reproducible on v0.117.0.

Description

When lineNOS is set in site config, writing a long line in code block will result in unwrapped text.

Markup config that caused this:

[markup]
defaultMarkdownHandler = 'goldmark'
[markup.highlight]
  codeFences = true
  guessSyntax = true
  style = 'monokai'
  lineNos = true
  lineNumbersInTable = true

Steps to reproduce

hugo new site test
cd test/
git clone https://github.com/joeroe/risotto themes/risotto

mkdir -p content/post/
cp themes/risotto/exampleSite/content/post/markdown-syntax.md content/post/
cp themes/risotto/exampleSite/config.toml ./
cp -r themes/risotto/layouts/* layouts/

sed -i 's/Test/Redit teque digerit hominumque toris verebor lumina non cervice subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum./g' content/post/markdown-syntax.md
# copy my config above to config.toml

hugo server

Then go to http://localhost:1313/post/markdown-syntax/ and you'll find this: firefox_0qPaIbFgMZ cleaned

What I Expect

It gets wrapped, just like what Code block indented with four spaces shows.

Edit: add Hugo version and more info.

Vinfall commented 1 year ago

Glad to see new commits coming, but this issue is still not solved with Hugo v0.117.0+extended and risotto v0.3.0. I'll update the content to match latest version.

joeroe commented 1 year ago

I think you expect it to be clipped with a scrollbar (as in the second code block in your screenshot), not wrapped, right? I don't think most people would appreciate text wrapping in a <pre> block.

Vinfall commented 1 year ago

Oh so scrollbar is what I want and using latest commit solves this for me. Many thanks!