1
0
mirror of https://github.com/golang/go synced 2024-11-18 13:04:46 -07:00

godoc: don't select line numbers when highlighting source code

CSS3 introduces the user-select property, which you can use to prevent snippets
of text from being highlighted. This is also the technique used by Github to
avoid highlighting line numbers when highlighting source code.

For more information, see:

https://developer.mozilla.org/en-US/docs/Web/CSS/user-select
https://www.w3.org/TR/1999/WD-css3-userint-19990916#user-select

Fixes golang/go#18279

Change-Id: Ia5eb68d5a042d6ee2a1c8e7bbad753a35de5c487
Reviewed-on: https://go-review.googlesource.com/34278
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
This commit is contained in:
Kevin Burke 2016-12-10 20:50:47 -08:00 committed by Brad Fitzpatrick
parent 7932c3d4c8
commit 0a14ca4e16
2 changed files with 12 additions and 0 deletions

View File

@ -2860,6 +2860,12 @@ pre .selection-comment {
pre .ln {
color: #999;
}
.ln {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
body {
color: #222;
}

View File

@ -30,6 +30,12 @@ pre .selection-comment {
pre .ln {
color: #999;
}
.ln {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
body {
color: #222;
}