Remove href

master
Bob Mottram 2019-08-30 17:18:34 +01:00
parent 2ad1b51f9a
commit af10d731a2
1 changed files with 7 additions and 0 deletions

View File

@ -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(':'):