mirror of https://gitlab.com/bashrc2/epicyon
Merge branch 'main' of gitlab.com:bashrc2/epicyon
commit
a77b1ebff0
16
markdown.py
16
markdown.py
|
@ -275,7 +275,7 @@ def _markdown_replace_code(markdown: str) -> str:
|
|||
line_ctr = 0
|
||||
changed = False
|
||||
section_active = False
|
||||
urlencode = False
|
||||
url_encode = False
|
||||
html_escape_table = {
|
||||
"&": "&",
|
||||
'"': """,
|
||||
|
@ -291,22 +291,22 @@ def _markdown_replace_code(markdown: str) -> str:
|
|||
if line.startswith('```'):
|
||||
if not section_active:
|
||||
if 'html' in line or 'xml' in line or 'rdf' in line:
|
||||
urlencode = True
|
||||
url_encode = True
|
||||
start_line = line_ctr
|
||||
section_active = True
|
||||
else:
|
||||
lines[start_line] = '<code>'
|
||||
lines[line_ctr] = '</code>'
|
||||
if urlencode:
|
||||
if url_encode:
|
||||
lines[start_line] = '<pre>\n<code>'
|
||||
lines[line_ctr] = '</code>\n</pre>'
|
||||
for line_num in range(start_line + 1, line_ctr):
|
||||
lines[line_num] = \
|
||||
"".join(html_escape_table.get(char, char)
|
||||
for char in lines[line_num])
|
||||
for line_num in range(start_line + 1, line_ctr):
|
||||
lines[line_num] = \
|
||||
"".join(html_escape_table.get(char, char)
|
||||
for char in lines[line_num])
|
||||
section_active = False
|
||||
changed = True
|
||||
urlencode = False
|
||||
url_encode = False
|
||||
line_ctr += 1
|
||||
|
||||
if not changed:
|
||||
|
|
11
session.py
11
session.py
|
@ -396,6 +396,17 @@ def verify_html(session, url: str, debug: bool,
|
|||
url)
|
||||
return False
|
||||
verification_site_html = verification_site_html.decode()
|
||||
|
||||
# does the site contain rel="me" links?
|
||||
if ' rel="me" ' not in verification_site_html:
|
||||
return False
|
||||
|
||||
# ensure that there are not too many rel="me" links
|
||||
sections = verification_site_html.split(' rel="me" ')
|
||||
me_links_count = len(sections) - 1
|
||||
if me_links_count > 5:
|
||||
return False
|
||||
|
||||
actor_links = [
|
||||
domain + '/@' + nickname,
|
||||
domain + '/users/' + nickname
|
||||
|
|
Loading…
Reference in New Issue