]> git.sesse.net Git - vlc/commitdiff
Added support for \N \n and \h in subtitles.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 11 Jan 2010 20:36:43 +0000 (21:36 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 13 Jan 2010 18:28:37 +0000 (19:28 +0100)
modules/codec/subtitles/subsdec.c

index 9d32434c8012be5fef9ee6301c32837d32e3a07c..80b25626a5926cbc28edd86f07938250d4bba3c2 100644 (file)
@@ -955,6 +955,25 @@ static char *CreateHtmlSubtitle( int *pi_align, char *psz_subtitle )
             /* Hide {Y:stupidity} */
             psz_subtitle = strchr( psz_subtitle, '}' ) + 1;
         }
+        else if( psz_subtitle[0] == '\\' && psz_subtitle[1] )
+        {
+            if( psz_subtitle[1] == 'N' || psz_subtitle[1] == 'n' )
+            {
+                HtmlPut( &psz_html, "<br/>" );
+                psz_subtitle += 2;
+            }
+            else if( psz_subtitle[1] == 'h' )
+            {
+                /* Non breakable space */
+                HtmlPut( &psz_html, NO_BREAKING_SPACE );
+                psz_subtitle += 2;
+            }
+            else
+            {
+                HtmlPut( &psz_html, "\\" );
+                psz_subtitle++;
+            }
+        }
         else
         {
             *psz_html = *psz_subtitle;