Tags:Highlight: Decomposed HTMLLegacy formatter (#8623)
Merge pull request 8623
This commit is contained in:
		
							parent
							
								
									ca2f106c8f
								
							
						
					
					
						commit
						ddbc8263de
					
				|  | @ -80,13 +80,17 @@ module Jekyll | ||||||
| 
 | 
 | ||||||
|       def render_rouge(code) |       def render_rouge(code) | ||||||
|         require "rouge" |         require "rouge" | ||||||
|         formatter = ::Rouge::Formatters::HTMLLegacy.new( |         formatter = ::Rouge::Formatters::HTML.new | ||||||
|           :line_numbers => @highlight_options[:linenos], |         if @highlight_options[:linenos] | ||||||
|           :wrap         => false, |           formatter = ::Rouge::Formatters::HTMLTable.new( | ||||||
|  |             formatter, | ||||||
|  |             { | ||||||
|               :css_class    => "highlight", |               :css_class    => "highlight", | ||||||
|               :gutter_class => "gutter", |               :gutter_class => "gutter", | ||||||
|           :code_class   => "code" |               :code_class   => "code", | ||||||
|  |             } | ||||||
|           ) |           ) | ||||||
|  |         end | ||||||
|         lexer = ::Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText |         lexer = ::Rouge::Lexer.find_fancy(@lang, code) || Rouge::Lexers::PlainText | ||||||
|         formatter.format(lexer.lex(code)) |         formatter.format(lexer.lex(code)) | ||||||
|       end |       end | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue