diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 52c88b4..4bde3cc 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -233,17 +233,23 @@ def tidy_trip_cave(place): def tidy_trip_image_urls(text, date): y = str(date)[:4] + text = text.replace(' src="', f' src="/years/{y}/') text = text.replace(" src='", f" src='/years/{y}/") text = text.replace(f' src="/years/{y}//years/{y}/', f' src="/years/{y}/') text = text.replace(f" src='/years/{y}//years/{y}/", f" src='/years/{y}/") - text = text.replace(f' src="/years/{y}/expofiles/', f' src="/expofiles/') - text = text.replace(f" src='/years/{y}/expofiles/", f" src='/expofiles/") + text = text.replace(f' src="/years/{y}//expofiles/', f' src="/expofiles/') + text = text.replace(f" src='/years/{y}//expofiles/", f" src='/expofiles/") text = text.replace("\t", "") text = text.replace("\n\n\n", "\n\n") + + lines = text.splitlines() + for line in lines: + if "expofiles" in line: + print(f"tidy_trip_image_urls() - {y}\n {line}") return text def tidy_tid(tid, title):