Skip to content

chore(kno-11736): better cross-browser support for CodeBlock line number exclusion#1321

Merged
cellomatt merged 1 commit intomainfrom
cursor/KNO-11736-codeblock-line-number-exclusion-bf1f
Feb 19, 2026
Merged

chore(kno-11736): better cross-browser support for CodeBlock line number exclusion#1321
cellomatt merged 1 commit intomainfrom
cursor/KNO-11736-codeblock-line-number-exclusion-bf1f

Conversation

@cellomatt
Copy link
Contributor

@cellomatt cellomatt commented Feb 19, 2026

Description

This PR updates the CodeBlock component styling to prevent line numbers from being included when users manually select and copy code snippets.

Why:
This addresses customer feedback where manually highlighting and copying code from a CodeBlock unexpectedly included the line numbers, especially when only a portion of the code was selected. This change improves the user experience by ensuring only the code content is copied during manual selection.

How:
A CSS rule has been added to global.css targeting the .react-syntax-highlighter-line-number class with user-select: none (including vendor prefixes). This provides a more robust and cross-browser compatible solution than relying solely on inline styles to prevent line numbers from being selected.

Todos

Tasks

Screenshots

Current docs site in Safari:
image

With change:
image


Linear Issue: KNO-11736

Open in Cursor Open in Web

Add CSS rule with vendor prefixes for user-select: none targeting the
react-syntax-highlighter-line-number class. This ensures line numbers
are excluded from text selection when users manually highlight code.

Resolves KNO-11736

Co-authored-by: Matt Kufchak <matt.kufchak@gmail.com>
@cursor
Copy link

cursor bot commented Feb 19, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@linear
Copy link

linear bot commented Feb 19, 2026

@vercel
Copy link

vercel bot commented Feb 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 19, 2026 9:41pm

Request Review

@cellomatt cellomatt changed the title Codeblock line number exclusion chore(kno-11736): better cross-browser support for CodeBlock line number exclusion Feb 19, 2026
@cellomatt
Copy link
Contributor Author

Tested and confirmed that this update is now excluding line numbers in Safari where our current implementation does not (even though it currently works fine in Chrome)

@cellomatt cellomatt requested review from a team, MikeCarbone and kylemcd February 19, 2026 21:48
@cellomatt cellomatt marked this pull request as ready for review February 19, 2026 21:50
@cellomatt cellomatt merged commit d8d7731 into main Feb 19, 2026
5 checks passed
@cellomatt cellomatt deleted the cursor/KNO-11736-codeblock-line-number-exclusion-bf1f branch February 19, 2026 21:57
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.

3 participants