Class: HamdownCore::ScriptParser

Inherits:
Object
  • Object
show all
Defined in:
lib/hamdown_core/script_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(line_parser) ⇒ ScriptParser

Returns a new instance of ScriptParser.



8
9
10
# File 'lib/hamdown_core/script_parser.rb', line 8

def initialize(line_parser)
  @line_parser = line_parser
end

Instance Method Details

#parse(text) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/hamdown_core/script_parser.rb', line 12

def parse(text)
  case text[0]
  when '=', '~'
    parse_script(text)
  when '&'
    parse_sanitized(text)
  when '!'
    parse_unescape(text)
  else
    parse_text(text)
  end
end