REPOSITORY CODING · MEDIUM
Add readable line wrapping to subtitle exports
The import and export paths work, but layout currently returns one unwrapped string. Implement word wrapping shared by the layout command and VTT export. Preserve explicit newlines, Unicode characters and words longer than the width.
Architecture ExtensionSubtitle editing service
Work through a real codebase.
Choose an environment, investigate the existing implementation and use the tests to check your change. Sign in to open a workspace; execution and Ono usage follow your plan’s allowances.
Task requirements and environments
JavaScript · 50 minute session
- Times are integer milliseconds. Cue intervals include the start and exclude the end. IDs are unique within a document. Commands execute in order and return either a value or an error.
- Shift moves every selected start and end by the same signed delta. Validate the entire selection and expected revision before committing. No cue may start before zero.
- Layout preserves explicit line breaks and wraps on whitespace. Count Unicode code points; do not split long words. Width must be an integer from 1 to 120.
- Conflicts reports every overlapping pair within the same track, including nested cues. Adjacent cues and different tracks do not conflict. Order results by overlap start, then the sorted IDs.
- Snapshot cues are ordered by start, then end, then ID. Split, export, add and remove must keep their existing behavior. This service processes document batches, not collaborative edits.
React · 50 minute session
- Times are integer milliseconds. Cue intervals include the start and exclude the end. IDs are unique within a document. Commands execute in order and return either a value or an error.
- Shift moves every selected start and end by the same signed delta. Validate the entire selection and expected revision before committing. No cue may start before zero.
- Layout preserves explicit line breaks and wraps on whitespace. Count Unicode code points; do not split long words. Width must be an integer from 1 to 120.
- Conflicts reports every overlapping pair within the same track, including nested cues. Adjacent cues and different tracks do not conflict. Order results by overlap start, then the sorted IDs.
- Snapshot cues are ordered by start, then end, then ID. Split, export, add and remove must keep their existing behavior. This service processes document batches, not collaborative edits.