Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conversion for HTML to markdown #932

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
complete coverage of what is there
  • Loading branch information
caronc committed Oct 6, 2023
commit 4c1b5cabbe7bd4adea5f7a6d573eb996865075fe
2 changes: 1 addition & 1 deletion apprise/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 308,7 @@ def handle_starttag(self, tag, attrs):
self._preserver_cr = True

elif tag == 'a':
for name, link in attrs:
for name, link in attrs: # pragma: no branch
if name == 'href':
self._link = '(' link ')'
# Take an early exit for speed (in case there are more
Expand Down
5 changes: 5 additions & 0 deletions test/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 107,11 @@ def to_html(body):
"<a href='#'>my link</a>") == \
"test my link"

# a with missing href entry
assert to_html("<span></span<<span>test</span> "
"<a>my link</a>") == \
"test my link"

# </p> missing
assert to_html("<body><div>line 1 <b>bold</b></div> "
" <a href='#'>my link</a>"
Expand Down