Skip to content

Commit 3f61a8e

Browse files
committed
Treat span style as optional
1 parent 01dad37 commit 3f61a8e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/mediathek/tool/ttml/TimedTextMarkupLanguageParser.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,10 @@ private void buildFilmList() throws Exception {
237237
final StyledString textContent = new StyledString();
238238
textContent.setText(node.getTextContent());
239239

240-
final List<String> colors = colorMap.get(styleNode.getNodeValue());
240+
final List<String> colors =
241+
(styleNode != null && colorMap.containsKey(styleNode.getNodeValue()))
242+
? colorMap.get(styleNode.getNodeValue())
243+
: null;
241244
if (colors == null) {
242245
textContent.setColor(color); // gabs beim BR
243246
textContent.setBackgroundColor(backgroundColor);

src/test/resources/ttml/testcase1.ttml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<tt:span style="textYellow">dann machen die Leute das leider.</tt:span>
6464
</tt:p>
6565
<tt:p xml:id="sub8" region="bottom" begin="00:00:35.834" end="00:00:38.394">
66-
<tt:span style="textWhite">Oft geht es gleich</tt:span>
66+
<tt:span>Oft geht es gleich</tt:span>
6767
<tt:br/>
6868
<tt:span style="textWhite">um mehrere Tausend Euro.</tt:span>
6969
</tt:p>

0 commit comments

Comments
 (0)