Method: Html5TokenizerTestCase#concatenate_consecutive_characters

Defined in:
lib/feed_tools/vendor/html5/tests/test_tokenizer.rb

#concatenate_consecutive_characters(tokens) ⇒ Object



47
48
49
50
51
52
53
54
55
# File 'lib/feed_tools/vendor/html5/tests/test_tokenizer.rb', line 47

def concatenate_consecutive_characters(tokens)
  tokens.inject([]) do |tokens, token|
    if type_of?('Character', token) and tokens.any? and type_of?('Character', tokens.last)
      tokens.last[1] = tokens.last[1] + token[1]
      next tokens
    end
    tokens << token
  end
end