[vlc-devel] Re: [patch] modules/codec/subsdec.c: bugfix for stripping HTML tags in subtitles

Sigmund Augdal sigmunau at stud.ntnu.no
Mon Jan 24 15:41:33 CET 2005


On Mon, Jan 24, 2005 at 02:57:41AM +0100, Christian Hammers wrote:
> Hello
> 
> The StripTags() function in modules/codec/subsdec.c from 0.8.1 (and 
> subversion trunk) is broken.
> 
> I have a .srt subtitle file with HTML tags in it. The StripTags() function
> is called on these lines but strips only the second and further tags,
> not the first one i.e.
> 	<font color=#ff0000>hello world</font>
> becomes                               
> 	<font color=#ff0000>hello world
> and not                                ^^^^
> 	hello world
> 
> My version also does not "end" a tag when spaces or newlines are
> encountered. That was necessary for those HTML formatted subtitles.
It doesn't, as you claim, only remove second and further tags. The first tag
isn't removed since it is considered to not be a tag since it has a space in
it. This was a chioce I made some time ago, and it did make sense to me at
that point. I think the ratsionale was that someone might want to have < or
> in a subtitle without this acutually being html-formated. 

> 
> Storing the HTML information to generate coloured, bold and italic
> subtitles would be cool, too but that means a bit more work, I fear.
indeed, but the subtitle system in vlc gets better and better with time,
perhaps some day it will be doable without much effort.


Sigmund

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list