Commit 04665a54 authored by Remi Rampin's avatar Remi Rampin

Get rid of meaningless <a>

parent a52ad337
......@@ -90,6 +90,7 @@ def get_html_body(body):
# Update 'href' URLs
for e in soup.find_all('a'):
if 'href' not in e.attrs:
e.replace_with(e.text)
continue
href = e.attrs['href'].lower()
if not (href.startswith('http://') or
......
......@@ -26,7 +26,7 @@ class TestConvert(AsyncTestCase):
body = (
b"<!DOCTYPE html>\n"
b"<html>\n <head>\n <title>Test</title>\n</head>\n<body>"
b"<h1>Example</h1><p>This is an example text document.\n"
b"<h1>Example</h1><p>This is an <a>example</a> text document.\n"
b"It should be <blink>converted</blink>.</p>\n\n"
b"<p>It has another paragraph <strong>here</strong>, "
b"images: <img width=\"50\" src=\"here.png\"> "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment