* fix: preserve color codes in STL
* add STLColor in StyleAttributes, and cleanup stl color code
* parse ttml colors and propagate to stl
* add tests on stl colors
* refactor color fields from *string to *Color
* rename newColorFromTTMLString to newColorFromHTMLString
* add Color.HTMLString and Color.CSSString
* rename Color.CSSString to Color.WebVTTString
* improve WebVTT to TTML conversion
* introduce a WebVTTPosition struct to store x-position and optional alignment
* remove unused map
* include propagateWebVTTPosition into propagateWebVTTAttributes
* [ttml] Support style and region inheritance body>div>p
* [ttml/test] Test case for style and region inheritance
* Add more case
* Rename function and correct code
* Updated escaping to be general for ampersand and escape for srt
* Moved html escaping to subtitles.go and updated tests
* Move back to using acceptable list of escapable html entities
* Detect UTF-8 for vtt/srt, error if encoded otherwise
* Switch to isValidUTF8Reader
* Remove isValidUTF8Reader function
* Enforce valid UTF8 on each SRT and WebVTT line
* Add benchmark tests for webvtt and srt
* Update benchmark test
* Add non-utf-8 tests and files
* Remove benchmarks
* Simple support for WebVTT style
* fixup! Simple support for WebVTT style
* [webvtt/test] Add cases of STYLES
* [webvtt] Use long condition instead of function
---------
Co-authored-by: Nhan Nguyen <nhan.trong.nguyen@edgeware.tv>
* Support parsing srt without sequence numbers.
There are many srt in the wild that are missing sequence numbers. It's
easy to detect by looking for an empty line vs index/sequence in the
line before the time. In my analysis of many srt I have not seen ones
missing the empty line, but it's feasible that these also exist. This
shouldn't affect parsing otherwise, however, and in my experience the
missing sequence number is common enough that it's useful to handle.
* Remove duplicate testdata file and use existing.
* 1. Fixed improper spacing between captions while converting TTML -> VTT
2. Added String To Pointer utility.
3. Converted TTML style attributes to pointers
4. Fixed Webvtt not using parent style attributes in region
* 1. Fixed Test cases
2. Fixed SRT and STL strings join
* 1. Removed Util
2. Added Regex to remove multiple space
3. In ttml.go update 'getStyleAttributes()' to 'newStyleAttributesFromTTMLInStyleAttributes()'
4. Using go-astikit to convert string to string pointer.
* Improper spacing fix
* Improper spacing fix
* Added Space in TTML out.
Added comments
* Added space to fix unit test
* update go.sum
* update go.sum
* Update go.sum
* Update go.sum
* Add support for open stl subtitles
* Adding STL OPN test and some more metadata
* Updated based on comments
* Moved functions from open_subtitle.go to stl.go
* Updated based on comments
* Fix a bug parsing lines with only spaces
Adds a simple test file, broken-in.vtt, that starts with a single
space character, followed by a newline. In master this file panics
with an index out-of-bounds. This is fixed by checking both that
the line length is greater than zero, and that the resulting fields
length is also greater than zero.
* Updates based on PR feedback