module Jekyll::Furigana

Constants

VERSION

Public Instance Methods

furigana(html) click to toggle source
# File lib/jekyll/furigana.rb, line 5
def furigana(html)
  return html unless furi_enabled?

  html.gsub!(/(\[|「|\(|\{)(.+?):(.+?)(\]|」|\)|\})/, "<ruby><rb>\\2</rb><rp>(</rp><rt>\\3</rt><rp>)</rp></ruby>")
  html
end

Private Instance Methods

furi_enabled?() click to toggle source
# File lib/jekyll/furigana.rb, line 14
def furi_enabled?
  @context.registers[:page]['furigana'] == true
end