class Hamdown::MdRegs::Fonts
class with logic of markdown's bold, link, bold italic text
Constants
- REGS
Private Instance Methods
text_handler(text, scan_res)
click to toggle source
# File lib/hamdown/md_regs/fonts.rb 13 def text_handler(text, scan_res) 14 scan_res = scan_res.map { |i| i.lstrip } 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