mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 09:56:15 -04:00
Changeset: Migrate from OpIter
to deserializeOps()
This commit is contained in:
parent
0eca0251f2
commit
89fe40e080
16 changed files with 147 additions and 179 deletions
|
@ -67,12 +67,10 @@ exports.setPadHTML = async (pad, html) => {
|
|||
const builder = Changeset.builder(1);
|
||||
|
||||
// assemble each line into the builder
|
||||
const attribsIter = Changeset.opIterator(newAttribs);
|
||||
let textIndex = 0;
|
||||
const newTextStart = 0;
|
||||
const newTextEnd = newText.length;
|
||||
while (attribsIter.hasNext()) {
|
||||
const op = attribsIter.next();
|
||||
for (const op of Changeset.deserializeOps(newAttribs)) {
|
||||
const nextIndex = textIndex + op.chars;
|
||||
if (!(nextIndex <= newTextStart || textIndex >= newTextEnd)) {
|
||||
const start = Math.max(newTextStart, textIndex);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue