Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 37415a8

Browse files
committedAug 29, 2008
array slicing works different in ruby than in python
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%401206
1 parent f744e7d commit 37415a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/html5/tokenizer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def data_state
287287
else
288288
chars = @stream.chars_until(["&", "<", ">", "-"])
289289
@token_queue << {:type => :Characters, :data => data + chars}
290-
@lastFourChars += (chars[(-4 || chars.length), 4] || '').scan(/./)
290+
@lastFourChars += (chars[chars.length > 4 ? -4 : -chars.length, 4] || '').scan(/./)
291291
@lastFourChars = @lastFourChars[(@lastFourChars.length > 4 ? -4 : -@lastFourChars.length), 4] || []
292292
end
293293
return true

0 commit comments

Comments
 (0)
Please sign in to comment.