From af10d731a280b77b7c6bd4d86e74ab292939d25b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 30 Aug 2019 17:18:34 +0100 Subject: [PATCH] Remove href --- webinterface.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webinterface.py b/webinterface.py index d9285aded..b7ce6eec2 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1191,14 +1191,18 @@ def addEmbeddedAudio(content: str) -> str: for w in words: if extension not in w: continue + w=w.replace('href="','') if w.endswith('.'): w=w[:-1] + if w.endswith('"'): + w=w[:-1] if w.endswith(';'): w=w[:-1] if w.endswith(':'): w=w[:-1] if not w.endswith(extension): continue + if not (w.startswith('http') or w.startswith('dat:') or '/' in w): continue url=w @@ -1224,8 +1228,11 @@ def addEmbeddedVideo(content: str,width=400,height=300) -> str: for w in words: if extension not in w: continue + w=w.replace('href="','') if w.endswith('.'): w=w[:-1] + if w.endswith('"'): + w=w[:-1] if w.endswith(';'): w=w[:-1] if w.endswith(':'):