Skip to content

Commit 7ffad18

Browse files
committed
Use presence of "data-linenum" attr as toggle to show line numbers gutter, using its value as the start line if supplied.
1 parent eccd35d commit 7ffad18

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tasks/build.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,11 @@ grunt.registerHelper("syntax-highlight", function( options, callback ) {
126126
code = $t.html(),
127127
lang = $t.attr("data-lang") || getLanguageFromClass( $t.attr("class") ) || crudeHTMLcheck( code ),
128128
linenum = $t.attr("data-linenum") || 1,
129+
gutter = $t.attr("data-linenum") === undefined ? false : true,
129130
brush = nsh.getLanguage( lang ) || nsh.getLanguage( "js" ),
130131
highlighted = nsh.highlight( code, brush, {
131-
"first-line": linenum
132+
"first-line": linenum,
133+
gutter: gutter
132134
});
133135
$t.parent().replaceWith( $(highlighted).removeAttr("id") );
134136
});

0 commit comments

Comments
 (0)