mirror of
https://gitlab.com/octtspacc/staticoso
synced 2025-06-05 22:09:23 +02:00
Choos. log level + threads num.; Add HTML <pre> fix; Add md. extension
This commit is contained in:
@ -35,6 +35,18 @@ def StripTags(HTML, ToStrip): # Remove desired tags from the HTML
|
||||
t.replace_with('')
|
||||
return str(Soup)
|
||||
|
||||
def DoHTMLFixPre(HTML):
|
||||
if not ("<pre>" in HTML or "<pre " in HTML):
|
||||
return HTML
|
||||
Soup = MkSoup(HTML)
|
||||
Tags = Soup.find_all('pre')
|
||||
for t in Tags:
|
||||
FirstLine = str(t).splitlines()[0].lstrip().rstrip()
|
||||
if FirstLine.endswith('>'):
|
||||
New = MkSoup(str(t).replace('\n', '', 1))
|
||||
t.replace_with(New.pre)
|
||||
return str(Soup)
|
||||
|
||||
def WriteImgAltAndTitle(HTML, AltToTitle, TitleToAlt): # Adds alt or title attr. to <img> which only have one of them
|
||||
Soup = MkSoup(HTML)
|
||||
Tags = Soup.find_all('img')
|
||||
|
Reference in New Issue
Block a user