Skip to content

Commit

Permalink
Fix TTML position parsing (#2493)
Browse files Browse the repository at this point in the history
The TTML parser would accept 100%, but not 100.0%.

This makes the parser more flexible, so even 100.00000% is valid.

Fixes #2477
  • Loading branch information
kumarashu123 authored Apr 13, 2020
1 parent 9af3b9e commit 6a04bde
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
Aaron Vaage <vaage@google.com>
Alvaro Velad Galvan <alvaro.velad@mirada.tv>
Andy Hochhaus <ahochhaus@samegoal.com>
Ashutosh Kumar Mukhiya <ashukm4@gmail.com>
Benjamin Wallberg <benjamin.wallberg@bonnierbroadcasting.com>
Boris Cupac <borisrt2309@gmail.com>
Bryan Huh <bhh1988@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion lib/text/ttml_text_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ shaka.text.TtmlTextParser.RateInfo_ = class {
* @example 50.17% 10%
*/
shaka.text.TtmlTextParser.percentValues_ =
/^(\d{1,2}(?:\.\d+)?|100)% (\d{1,2}(?:\.\d+)?|100)%$/;
/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/;

/**
* @const
Expand Down

0 comments on commit 6a04bde

Please sign in to comment.