Skip to content

Commit 41cd87d

Browse files
author
Frank Pagan
committed
feat: setValue checks for prefix and suffix and removes them from value prior to setting value
1 parent 05715a3 commit 41cd87d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/setValue.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ HTMLHeadingElement.prototype.setValue = function(value) {
1818
const setValue = (el, value) => {
1919
if (value === null || value === undefined) return;
2020
let valueType = el.getAttribute('value-type');
21+
let prefix = el.getAttribute('value-prefix') || "";
22+
let suffix = el.getAttribute('value-suffix') || "";
23+
if (prefix)
24+
value = text.replace(prefix, "");
25+
if (suffix)
26+
value = text.replace(suffix, "");
2127

2228
if (el.tagName == 'INPUT' || el.tagName == 'TEXTAREA' || el.tagName == 'SELECT') {
2329
let {isCrdt} = getAttributes(el)

0 commit comments

Comments
 (0)