Fix --clean only cleaning last expression

This commit is contained in:
Augusto Gunsch 2021-11-15 22:14:52 -03:00
parent 96c0343adc
commit e51110847e
No known key found for this signature in database
GPG Key ID: F7EEFE29825C72DC
5 changed files with 5 additions and 24 deletions

View File

@ -241,9 +241,7 @@ class SubripFile:
# Remove lines matching any expression # Remove lines matching any expression
for regexp in expressions: for regexp in expressions:
subs = filter(lambda sub: not sub.matches(regexp), self.subs) self.subs = [sub for sub in self.subs if not sub.matches(regexp)]
self.subs = list(subs)
def shift(self, ms): def shift(self, ms):
for sub in self.subs: for sub in self.subs:

View File

@ -1 +1,2 @@
Even <a> Even <a>
whether the tag

View File

@ -4,16 +4,10 @@ This one is full of HTML tags.
Above, below, everywhere Above, below, everywhere
2 2
01:00:53,500 --> 01:00:55,200
The script should not
care whether the tag is
valid or not
3
01:00:56,000 --> 01:00:57,000 01:00:56,000 --> 01:00:57,000
It should just strip all of It should just strip all of
them mercilessly them mercilessly
4 3
01:00:58,100 --> 01:00:59,600 01:00:58,100 --> 01:00:59,600
Including this one! Including this one!

View File

@ -4,16 +4,10 @@ This one is full of HTML tags.
Above, below, everywhere Above, below, everywhere
2 2
00:00:53,500 --> 00:00:55,200
The script should not
care whether the tag is
valid or not
3
00:00:56,000 --> 00:00:57,000 00:00:56,000 --> 00:00:57,000
It should just strip all of It should just strip all of
them mercilessly them mercilessly
4 3
00:00:58,100 --> 00:00:59,600 00:00:58,100 --> 00:00:59,600
Including this one! Including this one!

View File

@ -4,16 +4,10 @@
<i>Above, below, everywhere</i> <i>Above, below, everywhere</i>
2 2
00:00:53,500 --> 00:00:55,200
<html>The script should not
care whether the tag is
valid or not</html>
3
00:00:56,000 --> 00:00:57,000 00:00:56,000 --> 00:00:57,000
<p>It should just strip all of <p>It should just strip all of
them mercilessly</p> them mercilessly</p>
4 3
00:00:58,100 --> 00:00:59,600 00:00:58,100 --> 00:00:59,600
<ul>Including this one!</ul> <ul>Including this one!</ul>