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

div overflow when enabled markup.highlight.lineNos and markup.highlight.lineNumbersInTable #917

Open
mchu1966 opened this issue Jun 25, 2024 · 0 comments

Comments

@mchu1966
Copy link

Describe the problem:

When I enabled the markup.highlight.lineNos and markup.highlight.lineNumbersInTable in hugo.toml, the syntax highlighting code block will overflow when the content is too long that exceed the div width.

Steps to reproduce:

  1. enable markup.highlight.lineNos and markup.highlight.lineNumbersInTable in hugo.toml
[markup.highlight]
lineNos = true
lineNumbersInTable = true
  1. create a syntax highlighting code block with long enough content

Observed Results:

  • What happened?
longlineoverflow

if I turn the lineNumbersInTable to false, the overflowed part will be hidden.

longlineoverflow_disable_linenumbersintable
  • What did you expect to happen?

The code block should hide the overflowed element, and able to be scrolled horizontally to view the content.
longlineoverflow_scroll

I added a workaround to _base.scss, to get my expecting result

.highlight {
  div,
  pre {
    margin: 2rem 0 2rem;
    padding: 1rem;
    border-radius: 1rem;
    overflow: auto; // <- add this
  }
}

I'm not sure if it will cause any breaking changes, or anywhere else needed to be updated in order to fix it, so open a issue. Thanks for helping.

Relevant code exceptions or logs

N/A

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

1 participant