mirror of
https://github.com/docling-project/docling-core.git
synced 2026-11-18 20:27:00 +00:00
* fix(webvtt): keep a sub-millisecond cue serializable TrackSource accepts any end_time greater than start_time, but a WebVTT timestamp only carries milliseconds. Rounding both ends of a sub-millisecond segment onto the same timestamp produced a zero-length WebVTTCueTimings, whose validator rejects it, so exporting the document raised ValidationError instead of emitting the cue. Build the cue timings through one helper that extends the end by the smallest representable step when rounding collapsed the range. Signed-off-by: laoyyu <laoyyu@users.noreply.github.com> * fix(webvtt): keep a sub-millisecond cue serializable TrackSource accepts any end_time greater than start_time, but a WebVTT timestamp only carries milliseconds. Rounding both ends of a sub-millisecond segment onto the same timestamp produced a zero-length WebVTTCueTimings, whose validator rejects it, so exporting the document raised ValidationError instead of emitting the cue. Build the cue timings through one helper that extends the end by the smallest representable step when rounding collapsed the range, and log a warning when that happens, so the loss of precision is visible instead of the timings being silently rewritten. Signed-off-by: laoyyu <laoyyu@foxmail.com> --------- Signed-off-by: laoyyu <laoyyu@users.noreply.github.com> Signed-off-by: laoyyu <laoyyu@foxmail.com> Co-authored-by: laoyyu <laoyyu@users.noreply.github.com>