archiving regardless of the view used
This commit is contained in:
parent
c1981b4cf2
commit
ab2271e6bf
|
@ -3,6 +3,7 @@
|
|||
## 1.4 - Unreleased
|
||||
- Making python-readability optional
|
||||
- Removing "next" and "previous" which are quite confusing and not obvious
|
||||
- Archiving now works regardless of the view you are in.
|
||||
- Fixing a crash when accessing an empty html page
|
||||
- Not trying to display non-image files to avoid errors. (this requires "file")
|
||||
|
||||
|
|
|
@ -3642,13 +3642,18 @@ archives, which is a special historical list limited in size. It is similar to `
|
|||
lines = lf.readlines()
|
||||
lf.close()
|
||||
to_write = []
|
||||
# let’s remove the mode
|
||||
url = url.split("##offpunk_mode=")[0]
|
||||
for l in lines:
|
||||
# we separate components of the line
|
||||
# to ensure we identify a complete URL, not a part of it
|
||||
splitted = l.split()
|
||||
if url not in splitted:
|
||||
if url not in splitted and len(splitted) > 0:
|
||||
current = splitted[1].split("##offpunk_mode=")[0]
|
||||
#sometimes, we must remove the ending "/"
|
||||
if url.endswith("/") and url[:-1] in splitted:
|
||||
if url == current:
|
||||
to_return = True
|
||||
elif url.endswith("/") and url[:-1] == current:
|
||||
to_return = True
|
||||
else:
|
||||
to_write.append(l)
|
||||
|
|
Loading…
Reference in New Issue