More bugfixes in comment offsets

This commit is contained in:
2026-03-18 19:17:53 +01:00
parent 46e7694ec6
commit 34240dfbd8
2 changed files with 19 additions and 4 deletions

View File

@@ -931,7 +931,11 @@ export class Frame implements IFrame {
}
// remove PHG token from ext and advance ext for further parsing
commentOffset += 7;
if (commentBefore !== undefined && commentBefore.length > 0) {
commentBefore = commentBefore.substring(7);
} else {
commentOffset += 7;
}
ext = ext.substring(7).trimStart();
continue;
@@ -1015,7 +1019,11 @@ export class Frame implements IFrame {
}
// remove DFS token from ext and advance ext for further parsing
commentOffset += 7;
if (commentBefore !== undefined && commentBefore.length > 0) {
commentBefore = commentBefore.substring(7);
} else {
commentOffset += 7;
}
ext = ext.substring(7).trimStart();
continue;
@@ -1062,7 +1070,11 @@ export class Frame implements IFrame {
}
// remove DF token from ext and advance ext for further parsing
commentOffset += 8;
if (commentBefore !== undefined && commentBefore.length > 0) {
commentBefore = commentBefore.substring(8);
} else {
commentOffset += 8;
}
ext = ext.substring(8).trimStart();
continue;
@@ -1081,7 +1093,7 @@ export class Frame implements IFrame {
} else if (commentBefore !== undefined && commentBefore.length > 0) {
extras.comment = commentBefore + comment;
} else {
extras.comment = comment;
extras.comment = comment.substring(commentOffset);
}
if (withStructure) {