fix: anchor MEDIA tag parsing

This commit is contained in:
Peter Steinberger
2026-01-24 03:46:07 +00:00
parent 4fa1517e6d
commit 951a4ea065
3 changed files with 21 additions and 0 deletions

View File

@@ -71,6 +71,13 @@ export function splitMediaFromOutput(raw: string): {
continue;
}
const trimmedStart = line.trimStart();
if (!trimmedStart.startsWith("MEDIA:")) {
keptLines.push(line);
lineOffset += line.length + 1; // +1 for newline
continue;
}
const matches = Array.from(line.matchAll(MEDIA_TOKEN_RE));
if (matches.length === 0) {
keptLines.push(line);