Regex fix
This commit is contained in:
@@ -455,7 +455,8 @@ def subtitle():
|
|||||||
safe = content.strip()
|
safe = content.strip()
|
||||||
# Simple paragraphization: collapse >2 newlines, wrap in <p>
|
# Simple paragraphization: collapse >2 newlines, wrap in <p>
|
||||||
paras = [p.strip() for p in re.split(r"\n{2,}", safe) if p.strip()]
|
paras = [p.strip() for p in re.split(r"\n{2,}", safe) if p.strip()]
|
||||||
items = "".join(f"<p>{re.sub(r'[\n\r]+', ' ', p)}</p>" for p in paras[:2000])
|
clean_paras = [re.sub(r'[\n\r]+', ' ', p) for p in paras[:2000]]
|
||||||
|
items = "".join(f"<p>{p}</p>" for p in clean_paras)
|
||||||
return (
|
return (
|
||||||
"<!doctype html><meta charset='utf-8'>"
|
"<!doctype html><meta charset='utf-8'>"
|
||||||
"<title>Transcript</title>"
|
"<title>Transcript</title>"
|
||||||
|
Reference in New Issue
Block a user