Id titles with clickable links + some title bugfixes

This commit is contained in:
2022-08-24 15:04:13 +02:00
parent 7b15de12cb
commit 9911018114
4 changed files with 28 additions and 27 deletions

View File

@ -8,19 +8,12 @@
| ================================= """
import html
import warnings
from Libs.bs4 import BeautifulSoup
from Modules.Utils import *
"""
ClosedTags = (
'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
'p', 'span', 'pre', 'code',
'a', 'b', 'i', 'del', 'strong',
'div', 'details', 'summary',
'ol', 'ul', 'li', 'dl', 'dt', 'dd')
OpenTags = (
'img')
"""
# Suppress useless bs4 warnings
warnings.filterwarnings('ignore', message='The input looks more like a filename than markup.')
def MkSoup(HTML):
return BeautifulSoup(HTML, 'html.parser')
@ -60,7 +53,6 @@ def AddToTagStartEnd(HTML, MatchStart, MatchEnd, AddStart, AddEnd): # This doesn
break
if FilterStart == MatchStart:
StartPos = i
# TagName = FirstRealItem(FirstRealItem(FilterStart.split('<')).split(' '))
if AddStart:
HTML = HTML[:i] + AddStart + HTML[i:]
AddStart = None