Skip to content

OCTO-11510 #391

Merged
OlteanuRares merged 1 commit into
mainfrom
OCTO-11510
Jul 23, 2026
Merged

OCTO-11510 #391
OlteanuRares merged 1 commit into
mainfrom
OCTO-11510

Conversation

@OlteanuRares

Copy link
Copy Markdown
Contributor

Summary

  • SAMI writer aligned with WebVTT reader's structured output: classes list emitted as class= attribute (not leaked into inline CSS), text-align derived from Layout alignment, VTT class styles produce valid CSS rules in stylesheet (.yellow { color: yellow; }), writing direction silently dropped (SAMI has no writing-mode).
  • Split pycaption/sami.py (809 lines) into pycaption/sami/ package: constants.py, parser.py, reader.py, writer.py with unchanged public API.
  • Bug fixes & cleanup: fix _recreate_style_block mutating caller's rules dict, filter webvtt_positioning/writing_direction from inline style output, inline dead extension-point hooks in reader, remove dead _encode method, add docstrings.

Test plan

  • 7 new WebVTT→SAMI tests (class spans, multiple CSS properties, positioning, writing direction dropped, plain cue regression, stylesheet output, multiple classes)
  • All 10 existing SAMI conversion tests pass (DFXP→SAMI, SRT→SAMI, SAMI→SAMI, WebVTT→SAMI)
  • Full test suite (480 tests) passes with no regressions
  • black, isort, ruff clean

…ckage

  (constants, parser, reader, writer). Emit VTT  as class
  attribute instead of leaking into inline CSS, add text-align from
  Layout alignment, produce valid stylesheet rules for VTT class styles,
  filter non-CSS keys, silently drop writing direction. Fix rules-dict
  mutation in _recreate_style_block, inline dead hooks, add docstrings.
@OlteanuRares
OlteanuRares requested a review from a team as a code owner July 22, 2026 07:15
@OlteanuRares
OlteanuRares merged commit 4e1772b into main Jul 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants