diff options
author | ache <ache@ache.one> | 2018-02-11 22:35:55 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2018-02-11 22:35:55 +0100 |
commit | 4c691a8d364ff60c9e2969134d57d3d8bc043cc0 (patch) | |
tree | a3d03822d2a196847789063537d0cc79a7c6acad | |
parent | Not a textarea test (diff) |
Better parsing
-rw-r--r-- | app.js | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,7 +1,7 @@ 'use strict'; -const START = /^(\[_+)/g; -const END = /(_+])/g; +const START = /^(\[_+)\n/g; +const END = /\n(_+])/g; function locator(value, fromIndex) { const index = value.indexOf(START, fromIndex); @@ -172,7 +172,7 @@ function plugin() { return eat(value.slice(0, value.search(END)) + value.match(END)[0] + eaten)({ type: 'html', value: `<textarea${prop2HTML(prop)}>` + - `${value.slice(value.match(START)[0].length + 1, value.search(END) - 1)}` + + `${value.slice(value.match(START)[0].length, value.search(END))}` '</textarea>', /* |