otsaloma / gaupol

Editor for text-based subtitle files
https://otsaloma.io/gaupol/
GNU General Public License v3.0
250 stars 35 forks source link

Text correction breaks HTML-colors #224

Closed Nadyita closed 4 months ago

Nadyita commented 4 months ago

Recently, a lot of subtitles, especially for reality shows, come with different colors for the speakers, because they speak over each other. When I run text corrections on these, Gaupol tries to replace every </font> <font color="XXX"> with just a space, even if the <font color="XXX"> actually switches to a new color. Example:

<font color="#00ff00">Yes, exactly.</font> <font color="#00ffff">Oh, wow!</font> <font color="#ffff00">Nice.</font>

would become

<font color="#00ff00">Yes, exactly. Oh, wow! Nice.</font>

It would be nice to have a switch to turn this off, because it makes it a lot harder for a deaf person to understand who said what.

otsaloma commented 4 months ago

Thanks for noticing! This is not one of the correction patterns that can be turned off, because it's supposed to be a harmless clean-up thing (often sensible after corrections). But, yes, this is wrong, I'll fix it. I'm guessing why this hasn't come up before is that usually these cases have dialogue with line-breaks. With line-breaks between the bug is not triggered.

<font color="#00ff00">- Yes, exactly.</font>
<font color="#00ffff">- Oh, wow!</font>
<font color="#ffff00">- Nice.</font>