Module: Rouge::Plugins::Redcarpet
- Included in:
- Kitabu::Markdown::Renderer
- Defined in:
- lib/kitabu/extensions/rouge.rb
Instance Method Summary collapse
Instance Method Details
#rouge_formatter(lexer) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/kitabu/extensions/rouge.rb', line 6 def rouge_formatter(lexer) = lexer.respond_to?(:options) ? lexer. : {} = .keys.map(&:to_sym).zip(.values).to_h [:start_line] = .fetch(:start_line, 1).to_i = .keys.map(&:to_sym).zip(.values).to_h Formatters::HTMLLegacy.new( {css_class: "highlight #{lexer.tag}"}.merge() ) end |