Class: Tomify::Markdown::HTML

Inherits:
Redcarpet::Render::HTML
  • Object
show all
Defined in:
lib/tomify/markdown.rb

Instance Method Summary collapse

Instance Method Details

#find_and_replace(text) ⇒ Object



9
10
11
# File 'lib/tomify/markdown.rb', line 9

def find_and_replace(text)
  text.gsub!(/!!\w+!!/) { |t| @options[:replace][t[2...-2]] }
end

#preprocess(text) ⇒ Object



4
5
6
7
# File 'lib/tomify/markdown.rb', line 4

def preprocess(text)
  text = find_and_replace(text) if @options[:replace]
  text
end