Skip to content

fix: linenos highlighting for Zola 0.22+ (#168)#171

Open
not-matthias wants to merge 4 commits into
mainfrom
feat/linenos-highlighting
Open

fix: linenos highlighting for Zola 0.22+ (#168)#171
not-matthias wants to merge 4 commits into
mainfrom
feat/linenos-highlighting

Conversation

@not-matthias
Copy link
Copy Markdown
Owner

@not-matthias not-matthias commented Apr 4, 2026

Summary

Fixes #168 — line numbers in code blocks were selectable and included when copying.

  • Update to Zola 0.22.1 (giallo syntax highlighter replaces table-based linenos)
  • Add user-select: none and proper spacing to .giallo-ln line numbers
  • Strip .giallo-ln elements before copying in codeblock.js
  • Add full-width highlight styling for .z-hl highlighted lines
  • Remove dead table-based linenos code from CSS and JS
  • Add reference page (/posts/linenos-test/) showing all highlighting features

Test plan

  • 8 Playwright tests covering: user-select, spacing, copy behavior, single/multi/range highlights, linenostart, hide_lines
  • All 65 existing tests pass (including 11 visual regression tests)
  • Manual review of light/dark theme highlight colors

Update nixpkgs flake input, fix removed nodePackages.prettier -> prettier,
and bump Dockerfile.test from Zola 0.19.2 to 0.22.1.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2026

Playwright Tests failed!

Download the test report from the workflow artifacts.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2026

Playwright Tests passed!

All visual regression tests passed successfully!

@not-matthias not-matthias force-pushed the feat/linenos-highlighting branch from a87fb07 to 50c539e Compare April 4, 2026 21:50
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2026

Playwright Tests passed!

All visual regression tests passed successfully!

- Add user-select: none and proper spacing to .giallo-ln
- Strip .giallo-ln elements before copying in codeblock.js
- Add full-width highlight styling for .z-hl lines
- Remove dead table-based linenos code (replaced by giallo in Zola 0.22)
- Darken light theme highlight color for better visibility
@not-matthias not-matthias force-pushed the feat/linenos-highlighting branch from 50c539e to c9a2fde Compare April 4, 2026 22:06
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2026

Playwright Tests passed!

All visual regression tests passed successfully!

Add linenos-test page as both user-facing reference and test fixture,
showing source and rendered output for each feature: line numbers,
single/multi/range highlights, linenostart, and hide_lines.
- Add -webkit-user-select prefix for Safari support
- Skip clipboard test on WebKit (no clipboard permissions API)
- Use webkitUserSelect fallback in user-select test assertion
@not-matthias not-matthias force-pushed the feat/linenos-highlighting branch from c9a2fde to 7029e31 Compare April 4, 2026 22:22
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2026

Playwright Tests passed!

All visual regression tests passed successfully!

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

Successfully merging this pull request may close these issues.

Linenos is Broken in Code Blocks

1 participant