Commit 4536d809 authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Rafaël Carré

Fix rendering of HTML reserved characters

If the character in the EIA-608 stream is one of the reserved characters,
escape it accordingly so that the HTML renders properly.
Signed-off-by: default avatarRafaël Carré <funman@videolan.org>
parent a3b22177
......@@ -996,9 +996,34 @@ static void Eia608TextLine( struct eia608_screen *screen, char *psz_text, int i_
CAT( "<u>" );
}
/* */
Eia608TextUtf8( utf8, p_char[x] );
CAT( utf8 );
if( b_html ) {
/* Escape XML reserved characters
http://www.w3.org/TR/xml/#syntax */
switch (p_char[x]) {
case '>':
CAT( "&gt;" );
break;
case '<':
CAT( "&lt;" );
break;
case '"':
CAT( "&quot;" );
break;
case '\'':
CAT( "&apos;" );
break;
case '&':
CAT( "&amp;" );
break;
default:
Eia608TextUtf8( utf8, p_char[x] );
CAT( utf8 );
break;
}
} else {
Eia608TextUtf8( utf8, p_char[x] );
CAT( utf8 );
}
/* */
b_last_underline = b_underline;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment