Starting work on proper line-numbering support.
parent
0600cbfa41
commit
3c36e43b0b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -867,10 +867,10 @@ article.snipt {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
min-height: 220px;
|
min-height: 220px;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
padding: 4px 5px 4px 4px;
|
padding: 4px 0 4px 0;
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
width: 583px;
|
width: 589px;
|
||||||
@include border-radius(0);
|
@include border-radius(0);
|
||||||
|
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
|
@ -884,6 +884,11 @@ article.snipt {
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
background-color: #C7C7C7;
|
background-color: #C7C7C7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> span {
|
||||||
|
display: block;
|
||||||
|
padding: 0 4px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,12 @@ class Snipt(models.Model):
|
||||||
else:
|
else:
|
||||||
self.stylized = highlight(self.code,
|
self.stylized = highlight(self.code,
|
||||||
get_lexer_by_name(self.lexer, encoding='UTF-8'),
|
get_lexer_by_name(self.lexer, encoding='UTF-8'),
|
||||||
HtmlFormatter(linenos='table', linenospecial=1, lineanchors='line'))
|
HtmlFormatter(linenos='table',
|
||||||
|
anchorlinenos=True,
|
||||||
|
lineanchors='L',
|
||||||
|
linespans='L',
|
||||||
|
)
|
||||||
|
)
|
||||||
self.line_count = len(self.code.split('\n'))
|
self.line_count = len(self.code.split('\n'))
|
||||||
|
|
||||||
if self.lexer == 'markdown':
|
if self.lexer == 'markdown':
|
||||||
|
|
Loading…
Reference in New Issue