diff --git a/lib/rdoc/markdown.rb b/lib/rdoc/markdown.rb index 15beaefcca..3442f76b1b 100644 --- a/lib/rdoc/markdown.rb +++ b/lib/rdoc/markdown.rb @@ -344,9 +344,8 @@ class RDoc::Markdown end def scan(reg) - if m = reg.match(@string[@pos..-1]) - width = m.end(0) - @pos += width + if m = reg.match(@string, @pos) + @pos = m.end(0) return true end @@ -1060,7 +1059,7 @@ class RDoc::Markdown self.pos = _save3 break end - _tmp = scan(/\A(?-mix:#*)/) + _tmp = scan(/\G(?-mix:#*)/) unless _tmp self.pos = _save3 break @@ -1100,7 +1099,7 @@ class RDoc::Markdown _save = self.pos while true # sequence _text_start = self.pos - _tmp = scan(/\A(?-mix:\#{1,6})/) + _tmp = scan(/\G(?-mix:\#{1,6})/) if _tmp text = get_text(_text_start) end @@ -1165,7 +1164,7 @@ class RDoc::Markdown self.pos = _save3 break end - _tmp = scan(/\A(?-mix:#*)/) + _tmp = scan(/\G(?-mix:#*)/) unless _tmp self.pos = _save3 break @@ -1225,7 +1224,7 @@ class RDoc::Markdown _save = self.pos while true # sequence - _tmp = scan(/\A(?-mix:={1,})/) + _tmp = scan(/\G(?-mix:={1,})/) unless _tmp self.pos = _save break @@ -1246,7 +1245,7 @@ class RDoc::Markdown _save = self.pos while true # sequence - _tmp = scan(/\A(?-mix:-{1,})/) + _tmp = scan(/\G(?-mix:-{1,})/) unless _tmp self.pos = _save break @@ -2130,7 +2129,7 @@ class RDoc::Markdown self.pos = _save break end - _tmp = scan(/\A(?-mix:[+*-])/) + _tmp = scan(/\G(?-mix:[+*-])/) unless _tmp self.pos = _save break @@ -9385,7 +9384,7 @@ class RDoc::Markdown self.pos = _save7 break end - _tmp = scan(/\A(?-mix:[^`\n]*$)/) + _tmp = scan(/\G(?-mix:[^`\n]*$)/) unless _tmp self.pos = _save7 end @@ -9476,7 +9475,7 @@ class RDoc::Markdown self.pos = _save15 break end - _tmp = scan(/\A(?-mix:[^`\n]*$)/) + _tmp = scan(/\G(?-mix:[^`\n]*$)/) unless _tmp self.pos = _save15 end @@ -9725,7 +9724,7 @@ class RDoc::Markdown _save3 = self.pos while true # sequence - _tmp = scan(/\A(?-mix:_+)/) + _tmp = scan(/\G(?-mix:_+)/) unless _tmp self.pos = _save3 break @@ -9755,7 +9754,7 @@ class RDoc::Markdown _save6 = self.pos while true # sequence - _tmp = scan(/\A(?-mix:_+)/) + _tmp = scan(/\G(?-mix:_+)/) unless _tmp self.pos = _save6 break @@ -9818,7 +9817,7 @@ class RDoc::Markdown break end _text_start = self.pos - _tmp = scan(/\A(?-mix:[:\\`|*_{}\[\]()#+.!><-])/) + _tmp = scan(/\G(?-mix:[:\\`|*_{}\[\]()#+.!><-])/) if _tmp text = get_text(_text_start) end @@ -9944,7 +9943,7 @@ class RDoc::Markdown self.pos = _save5 break end - _tmp = scan(/\A(?-mix:={1,}|-{1,})/) + _tmp = scan(/\G(?-mix:={1,}|-{1,})/) unless _tmp self.pos = _save5 break @@ -10096,7 +10095,7 @@ class RDoc::Markdown _save1 = self.pos while true # sequence _text_start = self.pos - _tmp = scan(/\A(?-mix:\*{4,})/) + _tmp = scan(/\G(?-mix:\*{4,})/) if _tmp text = get_text(_text_start) end @@ -10126,7 +10125,7 @@ class RDoc::Markdown self.pos = _save3 break end - _tmp = scan(/\A(?-mix:\*+)/) + _tmp = scan(/\G(?-mix:\*+)/) unless _tmp self.pos = _save3 break @@ -10173,7 +10172,7 @@ class RDoc::Markdown _save1 = self.pos while true # sequence _text_start = self.pos - _tmp = scan(/\A(?-mix:_{4,})/) + _tmp = scan(/\G(?-mix:_{4,})/) if _tmp text = get_text(_text_start) end @@ -10203,7 +10202,7 @@ class RDoc::Markdown self.pos = _save3 break end - _tmp = scan(/\A(?-mix:_+)/) + _tmp = scan(/\G(?-mix:_+)/) unless _tmp self.pos = _save3 break @@ -11564,7 +11563,7 @@ class RDoc::Markdown _save1 = self.pos while true # sequence - _tmp = scan(/\A(?-mix:[A-Za-z]+)/) + _tmp = scan(/\G(?-mix:[A-Za-z]+)/) unless _tmp self.pos = _save1 break @@ -11689,7 +11688,7 @@ class RDoc::Markdown _save2 = self.pos while true # sequence - _tmp = scan(/\A(?i-mx:[\w+.\/!%~$-]+)/) + _tmp = scan(/\G(?i-mx:[\w+.\/!%~$-]+)/) unless _tmp self.pos = _save2 break @@ -12553,7 +12552,7 @@ class RDoc::Markdown self.pos = _save10 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save10 end @@ -12690,7 +12689,7 @@ class RDoc::Markdown self.pos = _save24 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save24 end @@ -12867,7 +12866,7 @@ class RDoc::Markdown self.pos = _save40 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save40 end @@ -13004,7 +13003,7 @@ class RDoc::Markdown self.pos = _save54 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save54 end @@ -13181,7 +13180,7 @@ class RDoc::Markdown self.pos = _save70 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save70 end @@ -13318,7 +13317,7 @@ class RDoc::Markdown self.pos = _save84 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save84 end @@ -13495,7 +13494,7 @@ class RDoc::Markdown self.pos = _save100 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save100 end @@ -13632,7 +13631,7 @@ class RDoc::Markdown self.pos = _save114 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save114 end @@ -13809,7 +13808,7 @@ class RDoc::Markdown self.pos = _save130 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save130 end @@ -13946,7 +13945,7 @@ class RDoc::Markdown self.pos = _save144 break end - _tmp = scan(/\A(?-mix:`+)/) + _tmp = scan(/\G(?-mix:`+)/) unless _tmp self.pos = _save144 end @@ -14598,7 +14597,7 @@ class RDoc::Markdown _save = self.pos while true # choice - _tmp = scan(/\A(?-mix:[~*_`&\[\]()