Allow distinguishing tag names in badpenny.

This commit is contained in:
Ian Gulliver
2014-08-03 11:04:52 -07:00
parent 8aacb5cfdb
commit b11a659f0c
2 changed files with 13 additions and 8 deletions

View File

@@ -114,14 +114,16 @@ QUnit.test('Base', function(assert) {
assert.expect(1);
var content = [
'foo{{value1}}bar',
'foo{{(container}}contents{{)nottheend}}more contents{{)container}}bar',
'foo{{[repeated}}testing{{]notthis}}{{)repeated}}zig{{]repeated}}bar'
'foo{{(container1}}contents{{)nottheend}}more contents{{)container1}}bar',
'foo{{[repeated1}}testing{{]notthis}}{{)repeated1}}zig{{]repeated1}}bar'
].join('\n');
var expected = [
'foo<value>value1</value>bar\n',
'foo<container>contents{{)nottheend}}more contents</container>bar\n',
'foo<repeated>testing{{]notthis}}{{)repeated}}zig</repeated>bar'
'foo<value name="value1"></value>bar\n',
'foo<container name="container1">contents{{)nottheend}}more contents',
'</container>bar\n',
'foo<repeated name="repeated1">testing{{]notthis}}{{)repeated1}}zig',
'</repeated>bar'
].join('');
assert.equal(badpenny.parseFromString(content).innerHTML, expected);