Skip to content

Commit fccb310

Browse files
committed
use normal pre styles for syntax highlighter
Instead of applying styles to syntax highlighter blocks and trying to match verbatim sections to that, just use the normal <pre> styles. This simplifies the rules needed, and removes the need to extend the syntax highlighter's css rules.
1 parent fad06c3 commit fccb310

File tree

5 files changed

+13
-24
lines changed

5 files changed

+13
-24
lines changed

root/static/js/syntaxhighlighter.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ $(function () {
140140
config.highlight = all_lines;
141141
}
142142

143-
$(source).unwrap();
144143
SyntaxHighlighter.highlight(config, source);
145144
});
146145
});

root/static/less/pod.less

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ ul#index, #index ul { list-style-type: none; }
105105
overflow-y: hidden;
106106
}
107107

108-
.nogutter, .pod pre {
109-
padding-left: 10px;
110-
}
111108
.pod p.pod-error {
112109
border-left: 1px solid #f32;
113110
margin-left: -16px;
Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
1-
@import (less) "SyntaxHighlighter/shCore.css";
2-
@import (less) "SyntaxHighlighter/shThemeDefault.css";
3-
41
body .syntaxhighlighter {
5-
font-size: 90% !important;
6-
*, * *, * * * {
7-
font-family: @font-family-monospace !important;
8-
}
2+
font-size: 100% !important;
3+
margin: 0 !important;
4+
/* needs higher specificity than the syntax highligher's rules */
5+
&, *, * *, * * *, * * * * {
6+
font-family: inherit !important;
7+
}
98
}
109

11-
.pod pre.metacpan-verbatim {
12-
&:extend(.syntaxhighlighter);
13-
*:extend(.syntaxhighlighter a) {}
10+
.pod > pre {
11+
margin-left: 0px;
1412
}
15-
16-
.pod pre,
17-
.pod pre.metacpan-verbatim, /* keep the same specificity as shCore.css */
18-
.syntaxhighlighter {
19-
border: 1px solid #e9e9e9;
20-
width: auto !important;
21-
overflow-y: hidden !important;
22-
background-color: #fafafa;
13+
.pod pre {
2314
padding: 10px;
24-
-webkit-text-size-adjust: 100%; /* for iPhone <code>, issue #107 */
15+
overflow-y: auto;
16+
}
17+
pre code {
18+
white-space: pre;
2519
}
2620

2721
/* work around incompatibility between bootstrap and syntaxhighlighter
@@ -30,4 +24,3 @@ body .syntaxhighlighter {
3024
.syntaxhighlighter .container:after {
3125
content: none !important;
3226
}
33-

0 commit comments

Comments
 (0)