Class: BlueDoc::SML::Rules::Codeblock
- Extended by:
- Rouge::Plugins::Redcarpet
- Defined in:
- lib/bluedoc/sml/rules/codeblock.rb
Constant Summary
Constants inherited from Base
Class Method Summary collapse
Methods inherited from Base
Class Method Details
.match?(node) ⇒ Boolean
12 13 14 |
# File 'lib/bluedoc/sml/rules/codeblock.rb', line 12 def self.match?(node) tag_name(node) == "codeblock" end |
.to_html(node, opts = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/bluedoc/sml/rules/codeblock.rb', line 16 def self.to_html(node, opts = {}) attrs = attributes(node) language = attrs[:language] code = attrs[:code] || "" nid_attr = name_by_attrs(attrs) html = block_code(code, language) html.sub(%(class="highlight"), %(class="highlight"#{nid_attr})) end |