class Hamdown::MdRegs::Fonts2

class with logic of markdown's italic and monospace text

Constants

REGS

TODO: add '?:' to unuseful group /learn(?:bydoing)/

Private Instance Methods

text_handler(text, scan_res) click to toggle source
   # File lib/hamdown/md_regs/fonts2.rb
13 def text_handler(text, scan_res)
14   scan_res = scan_res.map { |i| i[0] }.reject{ |i| i.nil? }
15   html_scan = scan_res.map do |i|
16     s = md_to_html(i)
17     # delete <p> in start and end of line
18     s = s[3, s.size]
19     s = s[0..s.size - 6]
20     s
21   end
22   scan_res.each_with_index do |str, index|
23     text.gsub!(str, html_scan[index])
24   end
25 
26   text
27 end