DEV: Fix typo (#10)
This commit is contained in:
parent
1c4f5b1a99
commit
ba7ca9e588
|
@ -168,7 +168,7 @@ export default {
|
||||||
|
|
||||||
let diff = 0;
|
let diff = 0;
|
||||||
let replaced = false;
|
let replaced = false;
|
||||||
let newInnnerHTML = elem.innerHTML;
|
let newInnerHTML = elem.innerHTML;
|
||||||
|
|
||||||
mapping.forEach((m) => {
|
mapping.forEach((m) => {
|
||||||
if (
|
if (
|
||||||
|
@ -182,12 +182,12 @@ export default {
|
||||||
replaced = true;
|
replaced = true;
|
||||||
|
|
||||||
const previousLength = m.length;
|
const previousLength = m.length;
|
||||||
const prefix = newInnnerHTML.slice(0, m.position + diff);
|
const prefix = newInnerHTML.slice(0, m.position + diff);
|
||||||
const suffix = newInnnerHTML.slice(
|
const suffix = newInnerHTML.slice(
|
||||||
m.position + diff + m.length,
|
m.position + diff + m.length,
|
||||||
newInnnerHTML.length
|
newInnerHTML.length
|
||||||
);
|
);
|
||||||
newInnnerHTML = `${prefix}${newValue}${suffix}`;
|
newInnerHTML = `${prefix}${newValue}${suffix}`;
|
||||||
|
|
||||||
m.length = newValue.length;
|
m.length = newValue.length;
|
||||||
m.position = m.position + diff;
|
m.position = m.position + diff;
|
||||||
|
@ -195,7 +195,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (replaced) {
|
if (replaced) {
|
||||||
elem.innerHTML = newInnnerHTML;
|
elem.innerHTML = newInnerHTML;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue