mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-28 00:01:10 +00:00
Add small gap between line numbers and code
Change-Id: Ie65128872f318a42677e52420338684ad8d814f8
This commit is contained in:
parent
9c0e82878e
commit
6e558b37db
|
@ -346,7 +346,18 @@ class SyntaxHighlight {
|
|||
return null;
|
||||
}
|
||||
|
||||
return $result->getStdout();
|
||||
$out = $result->getStdout();
|
||||
|
||||
// Convert line numbers to data attributes so they
|
||||
// can be displayed as CSS generated content and be
|
||||
// unselectable in all browsers.
|
||||
$out = preg_replace(
|
||||
'`<span class="linenos">([^<]*)</span>`',
|
||||
'<span class="linenos" data-line="$1"></span>',
|
||||
$out
|
||||
);
|
||||
|
||||
return $out;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -42,8 +42,9 @@
|
|||
display: block;
|
||||
}
|
||||
|
||||
/* Make line numbers non copyable */
|
||||
.linenos {
|
||||
margin-right: 4px;
|
||||
/* Make line numbers non copyable */
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
|
|
Loading…
Reference in a new issue