class HTML::Pipeline::LFMarkdown
LinuxFr
Flavored Markdown
Constants
- HTML_OPTIONS
- PARSER_OPTIONS
Public Class Methods
new(extensions={})
click to toggle source
Calls superclass method
# File lib/html/pipeline/markdown_filter.rb, line 27 def initialize(extensions={}) super extensions.merge(HTML_OPTIONS) end
Public Instance Methods
header(text, header_level, anchor=nil)
click to toggle source
# File lib/html/pipeline/markdown_filter.rb, line 31 def header(text, header_level, anchor=nil) l = header_level + 1 "<h#{l}>#{text}</h#{l}>\n" end
image(link, title, alt_text)
click to toggle source
# File lib/html/pipeline/markdown_filter.rb, line 40 def image(link, title, alt_text) return "" if link.blank? ::Image.new(link, title, alt_text).to_html # FIXME end
normal_text(text)
click to toggle source
# File lib/html/pipeline/markdown_filter.rb, line 45 def normal_text(text) text = CGI.escapeHTML(text) text.gsub!('« ', '« ') text.gsub!(/ ([:;»!?])/, ' \1') text.gsub!(' -- ', '—') text.gsub!('...', '…') text end
strikethrough(text)
click to toggle source
# File lib/html/pipeline/markdown_filter.rb, line 36 def strikethrough(text) "<s>#{text}</s>" end