Skip to content

Code block highlighting issue on mobile resolution #7043

@lnxpy

Description

@lnxpy

Context

Python version: 3.11
Mkdocs-material version: 9.5.17
OS: MacOS Sonoma 14.4.1

Bug description

When the code inside a code block is a bit long (that makes it horizontally scrollable), the highlighted lines (via hl_lines="") break and don't cover the full width of the page.

telegram-cloud-photo-size-4-5823368744888550130-y

Related links

Reproduction

9.5.17-code-highlighting-issue.zip

Steps to reproduce

Create a code block with a long line highlighted with hl_lines="". View the code block in a lower screen size (like mobile) and you'll spot the issue.

Browser

Chrome, Brave

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions