lib/RichTextScanner.rb in taskjuggler-0.0.5 vs lib/RichTextScanner.rb in taskjuggler-0.0.6
- old
+ new
@@ -110,11 +110,11 @@
def fileName
'input text'
end
# The parser uses this function to report any errors during parsing.
- def error(id, text, foo)
+ def error(id, text, foo = nil, bar = nil)
if @debug
$stderr.puts "Line #{@lineNo}: #{text}\n" +
"#{@text[@lineStart, @pos - @lineStart]}"
else
raise RichTextException.new(id, @lineNo, text,
@@ -235,11 +235,11 @@
# All the lead characters of a token here also need to be registered
# with nextTokenNewline!
case (c = nextChar)
when '='
# Headings start with 2 or more = and must be followed by a space.
- level = readSequenceMax('=', 4)
+ level = readSequenceMax('=', 5)
if level == 1
# 1 = does not mean anything. Push it back and process it as normal
# text further down.
returnChar
else
@@ -254,19 +254,19 @@
level = readSequenceMax('-', 4)
return [ "HLINE", '-' * 4 ] if level == 4
returnChar(level)
when '*'
# Bullet lists start with one to three * characters.
- level = readSequenceMax('*')
+ level = readSequenceMax('*', 4)
# Between the * characters and the bullet text must be exactly one
# space.
return [ "BULLET#{level}", '*' * level ] if nextChar == ' '
# If that's missing, The # are treated as normal text further down.
returnChar(level + 1)
when '#'
# Numbered list start with one to three # characters.
- level = readSequenceMax('#')
+ level = readSequenceMax('#', 4)
# Between the # characters and the bullet text must be exactly one
# space.
return [ "NUMBER#{level}", '#' * level ] if nextChar == ' '
# If that's missing, The # are treated as normal text further down.
returnChar(level + 1)
@@ -320,10 +320,10 @@
returnChar(level)
@ignoreInlineMarkup = true
nil
end
elsif c == '=' && !@ignoreInlineMarkup
- level = readSequenceMax('=', 4)
+ level = readSequenceMax('=', 5)
if level > 1
[ "TITLE#{level - 1}END", '=' * level ]
else
# We have not found the right syntax. Treat found characters as
# normal text. Push all = back and start again but ignoring the =