Skip to content

Commit

Permalink
Add -webkit-user-select: none; to support Safari
Browse files Browse the repository at this point in the history
  • Loading branch information
CIAvash authored and alecthomas committed Jan 10, 2023
1 parent 45e3bfb commit 0e2db44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion formatters/html/html.go
Expand Up @@ -513,7 +513,7 @@ func (f *Formatter) styleToCSS(style *chroma.Style) map[chroma.TokenType]string
if f.wrapLongLines {
classes[chroma.PreWrapper] += `white-space: pre-wrap; word-break: break-word;`
}
lineNumbersStyle := `white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;`
lineNumbersStyle := `white-space: pre; -webkit-user-select: none; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;`
// All rules begin with default rules followed by user provided rules
classes[chroma.Line] = `display: flex;` + classes[chroma.Line]
classes[chroma.LineNumbers] = lineNumbersStyle + classes[chroma.LineNumbers]
Expand Down

0 comments on commit 0e2db44

Please sign in to comment.