Class: FujiMarkdown::Renderers::KakuyomuRenderer

Inherits:
TextRenderer
  • Object
show all
Defined in:
lib/fuji_markdown/renderers/kakuyomu_renderer.rb

Instance Method Summary collapse

Methods inherited from TextRenderer

#blockquote, #code, #header, #hrule, #paragraph, #softbreak

Instance Method Details

#code_block(node) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/fuji_markdown/renderers/kakuyomu_renderer.rb', line 6

def code_block(node)
  out("\n") if node.previous&.type&.==(:paragraph)
  block do
    out(escape_html(node.string_content))
  end
  out("\n")
end

#emph(_) ⇒ Object



14
15
16
# File 'lib/fuji_markdown/renderers/kakuyomu_renderer.rb', line 14

def emph(_)
  out('《《', :children, '》》')
end


18
19
20
# File 'lib/fuji_markdown/renderers/kakuyomu_renderer.rb', line 18

def link(_node)
  out(:children)
end