Starting work on proper line-numbering support.

master
Nick Sergeant 2013-03-25 19:37:46 -04:00
parent 0600cbfa41
commit 3c36e43b0b
4 changed files with 15 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -867,10 +867,10 @@ article.snipt {
margin: 0;
min-height: 220px;
overflow-x: auto;
padding: 4px 5px 4px 4px;
padding: 4px 0 4px 0;
white-space: pre;
word-wrap: normal;
width: 583px;
width: 589px;
@include border-radius(0);
&::-webkit-scrollbar {
@ -884,6 +884,11 @@ article.snipt {
border-radius: 16px;
background-color: #C7C7C7;
}
> span {
display: block;
padding: 0 4px;
}
}
}
}

View File

@ -72,7 +72,12 @@ class Snipt(models.Model):
else:
self.stylized = highlight(self.code,
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'))
if self.lexer == 'markdown':