Class: FujiMarkdown::Preprocessors::Ruby

Inherits:
Object
  • Object
show all
Defined in:
lib/fuji_markdown/preprocessors/ruby.rb

Constant Summary collapse

RUBY_REGEXP =
/(?<!\\){(?<kanji>.*?)\|(?<kana>.*?)}/.freeze

Instance Method Summary collapse

Instance Method Details

#call(text) ⇒ Object



8
9
10
11
12
# File 'lib/fuji_markdown/preprocessors/ruby.rb', line 8

def call(text)
  text.gsub(RUBY_REGEXP) do |ruby_pattern|
    convert_to_html(ruby_pattern)
  end
end