diff --git a/js/htmldiff.js b/js/htmldiff.js index 7310ba0..a76a3d7 100644 --- a/js/htmldiff.js +++ b/js/htmldiff.js @@ -88,18 +88,26 @@ return result && result[1]; } + // inspect the last tag in word (from its opening '<'); to an earlier '>' in that + // slice means loose text e.g. "a > b" in a '; + expect(cut('
' + atomic + '
')).eql( + tokenize(['', atomic, '
'])); + }); + + it('should ignore self-closing same-named children when counting depth', function(){ + var atomic = 'xy'; + expect(cut(atomic)).eql(tokenize([atomic])); + }); + + it('should ignore self-closing same-named children written with a space ()', function(){ + var atomic = 'xy'; + expect(cut(atomic)).eql(tokenize([atomic])); + }); + + it('should not bump depth on differently-named tags that share a prefix', function(){ + // a tag must not be matched by an atomic tag named "a" appearing as