diff options
-rw-r--r-- | __tests__/index.js | 9 | ||||
-rw-r--r-- | app.js | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/__tests__/index.js b/__tests__/index.js index 38a3dbf..9f256b0 100644 --- a/__tests__/index.js +++ b/__tests__/index.js @@ -97,10 +97,15 @@ _______]`); test('simple-raw2', t => { const {contents} = renderRaw('[____\nHere some text\n____]\n\n<div>Yeah !</div>'); - t.is(contents.toLowerCase(), '<textarea>here some text</textarea>'); + console.log('@@' + contents.toLowerCase() + '@@'); + t.is(contents.toLowerCase(), '<textarea>here some text</textarea>\n<div>yeah !</div>'); +}); + +test('id', t => { + const {contents} = renderRaw('[____\nHere some text\n____]{#id}'); + t.is(contents.toLowerCase(), '<textarea id="id">here some text</textarea>'); }); -test.todo('id text'); test.todo('class'); test.todo('classes'); test.todo('key-value'); @@ -34,7 +34,7 @@ function plugin() { if (end !== value.match(START)[0].length) { end -= 1; } - const t = eat(value.slice(0, value.match(END)[0].lenght) + eaten)({ + const t = eat(value.slice(0, value.search(END) + value.match(END)[0].length) + eaten)({ type: 'textarea', data: { hName: 'TEXTAREA', |