diff options
author | @che <ache@ache.one> | 2018-09-16 22:32:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-16 22:32:57 +0200 |
commit | 3976ae898cbab04ed19c791a39c9c4a7fe584d51 (patch) | |
tree | fe31f6d82c9c165162f0505379b3c5c20025b1df /__tests__ | |
parent | Merge pull request #3 from Hypercubed/patch-1 (diff) | |
parent | Fix braces parsing in quotes (diff) |
Merge pull request #5 from Hypercubed/fix/braces
Fix braces parsing in quotes
Diffstat (limited to '__tests__')
-rw-r--r-- | __tests__/index.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/__tests__/index.js b/__tests__/index.js index 56158bb..1be433c 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -546,3 +546,17 @@ test('defaultValue name', t => { t.is(r.eaten, 'visible'); }); +test('braces in attr', t => { + const toParse = `{ data-json='{"a": 1, "b": 2}' }`; + const r = parse(toParse); + t.is(r.prop['data-json'], '{"a": 1, "b": 2}'); + t.is(r.eaten, toParse); +}); + +test('nested braces in attr', t => { + const toParse = `{ data-json='{"a": 1, "b": { "c": 4 }}' }`; + const r = parse(toParse); + t.is(r.prop['data-json'], '{"a": 1, "b": { "c": 4 }}'); + t.is(r.eaten, toParse); +}); + |