Skip to content

Support body div level style and region#131

Merged
asticode merged 4 commits intoasticode:masterfrom
NhanNguyen700:support-body-div-level-style-and-region
Oct 14, 2025
Merged

Support body div level style and region#131
asticode merged 4 commits intoasticode:masterfrom
NhanNguyen700:support-body-div-level-style-and-region

Conversation

@NhanNguyen700
Copy link
Contributor

Hi @asticode ,

Style and region for ttml can be specify in body and div too, please refer to testdata/example-in-style-inheritance.ttml to see the real case. Style/region will be inherited by this order body>div>p.

Besides, according to TTML standard, when both parent node and child node define style/region, the one in child node will win. Thus, I implement an override mechanism in your TTML parsing step to bring all the style/region from parent node down to the item (

<\p>) node if there is no corresponding attribute in the child node. With that, the "Subtitles" object structure will not be broken and the style/region can be preserved. The side-effect is that the output TTML can be a little bit longer compare to input TTML.

@NhanNguyen700
Copy link
Contributor Author

ping @asticode for reminding

Copy link
Owner

@asticode asticode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and sorry for the delayed review ❤️

@asticode asticode merged commit 90801f8 into asticode:master Oct 14, 2025
1 check passed
@asticode
Copy link
Owner

Thanks for the PR ❤️

Let me know whether you need a tag 👍

@NhanNguyen700
Copy link
Contributor Author

@asticode , Yes, I need it, could you do me a favor and create a tag for my project?

@asticode
Copy link
Owner

@asticode , Yes, I need it, could you do me a favor and create a tag for my project?

FYI I've created a v0.36.0 tag 👍

@NhanNguyen700
Copy link
Contributor Author

Many thanks for that!

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.

2 participants