-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Srt html styling #121
Srt html styling #121
Conversation
d7242fd
to
1cf96aa
Compare
1cf96aa
to
e677551
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for picking up this PR ❤️
A few changes are needed for tests 👍
testdata/example-styled-in.srt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename this file to example-in-styled.srt
?
testdata/example-styled-out.srt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename this file to example-out-styled.srt
?
testdata/example-styled-out.vtt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename this file to example-out-styled.vtt
?
srt_test.go
Outdated
assert.Equal(t, string(c), w.String()) | ||
} | ||
|
||
func TestReadSRTWriteWebVTTStyled(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you not create a separate test for that and instead add writing to vtt at the end of TestSRTStyled
?
srt_test.go
Outdated
s, err := astisub.OpenFile("./testdata/example-styled-in.srt") | ||
assert.NoError(t, err) | ||
assertStyledSubtitleItems(t, s) | ||
assertSRTSubtitleStyles(t, s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you not make it a function and instead test the style directly in this function? It shouldn't be used elsewhere
subtitles_test.go
Outdated
assert.Equal(t, "'The time is 7:35.'", i.Items[5].Lines[1].String()) | ||
} | ||
|
||
func assertSRTSubtitleStyles(t *testing.T, i *astisub.Subtitles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should be removed based on my previous comment
All comments have been addressed. |
Thanks for the PR! ❤️ Let me know whether you need a tag 👍 |
A tag would be great! Thank you. |
I've created a |
This PR resurrects #96 The changes from the PR have been re-applied and made to work with the mast recent changes. For our use-case we often run into an srt file being uploaded with stylings that are then broken when converted to webvtt.
I believe all the comments that were apart of that PR have been addressed, but please let me know if other changes are needed.