Class: Jekyll::InlineHighlightBlock

Inherits:
Tags::HighlightBlock
  • Object
show all
Defined in:
lib/jekyll_inline_highlight.rb

Instance Method Summary collapse

Instance Method Details

#add_code_tag(code) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/jekyll_inline_highlight.rb', line 13

def add_code_tag(code)
  code_attributes = [
    "class=\"highlight language-#{@lang.to_s.gsub('+', '-')}\"",
    "data-lang=\"#{@lang.to_s}\""
  ].join(" ")
  "<code #{code_attributes}>#{code.chomp.strip}</code>"
end

#render(context) ⇒ Object



21
22
23
# File 'lib/jekyll_inline_highlight.rb', line 21

def render(context)
  super.strip
end