Jekyll Hack : Highlighting multiples lines with pygments jekyll, pygments, regexp

Hacking Jekyll : allow multiple lines highlight

In Jekyll files, change the regexp syntax for allowing passing multiple parameters :

File jekyll/lib/jekyll/tags/highlight.rb change from :

 5        
 6     # The regular expression syntax checker. Start with the language specifier.
 7     # Follow that by zero or more space separated options that take one of two
 8     # forms:
 9     #
10     # 1. name
11     # 2. name=value
12     SYNTAX = /^([a-zA-Z0-9.+#-]+)((\s+\w+(=\w+)?)*)$/
13 
14     ...
15 
16     # line 29 :
17       @options[key] = value
18     

to :

 5        
 6     # The regular expression syntax checker. Start with the language specifier.
 7     # Follow that by zero or more space separated options that take one of two
 8     # forms:
 9     #
10     # 1. name
11     #     linenos
12     # 2. name=value
13     #     linenos=table linenostart=56
14     # 3. name=value1,value2,value3 
15     #     hl_lines=2,7 linenos linenostart=56
16     SYNTAX = /^([a-zA-Z0-9.+#-]+)((\s+\w+(=\w+(,\w+)*)?)*)$/
17 
18     ...
19 
20     # line 29 :
21       @options[key] = value.gsub(',',' ')
22     

comments powered by Disqus