More fixes, sync with HTML5lib

Do a better job with the wrapper <div>s added by xhtmldiff and Maruku's to_html_tree method.
More tests fixed.
This commit is contained in:
Jacques Distler 2007-06-13 23:05:15 -05:00
parent 3ca33e52b5
commit 3de374d6c1
20 changed files with 541 additions and 118 deletions

View file

@ -27,13 +27,13 @@ module TokenConstructor
end
def text(data)
if data =~ /^([#{SPACE_CHARACTERS.join('')}]+)/
if data =~ /\A([#{SPACE_CHARACTERS.join('')}]+)/m
yield({:type => :SpaceCharacters, :data => $1})
data = data[$1.length .. -1]
return if data.empty?
end
if data =~ /([#{SPACE_CHARACTERS.join('')}]+)$/
if data =~ /([#{SPACE_CHARACTERS.join('')}]+)\Z/m
yield({:type => :Characters, :data => data[0 ... -$1.length]})
yield({:type => :SpaceCharacters, :data => $1})
else