Re-worked Telegram HTML/Markdown -> HTML Conversion #579
+185
−75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Related issue (if applicable): #changedetection.io/555, #573, #565, #566, #576, #572, and #577
This should complete the over-hall of Apprise/Telegram HTML support. Up until now Telegram Unit Tests and Usage pretty much worked well so long as the input provided into Apprise was
text
. But if the input provided wasHTML
orMarkdown
, there were very odd side effects.The biggest problem is Telegram's HTML support isn't really HTML at all. It only supports
<a>
,<b>
,<i>
, and<code>
.This completed change attempts to handle most (hopefully through bulletproofing later, i'll get all) unsuported (Telegram) HTML tags (such as
title
,body
,li
,ul
, etc, etc ) and convert them back to the closest supported tag (if not remove it all together). This change also attempts to respectblock
vsinline
code and places new lines where applicable during the transformation.Checklist
flake8
)Testing
Anyone can help test this source code as follows: