Skip to content

Commit

Permalink
Merge pull request opsdroid#31 from Cadair/master
Browse files Browse the repository at this point in the history
Backout markdown
  • Loading branch information
SolarDrew committed Jun 18, 2018
2 parents 11b57b7 + 3d73971 commit ddb0e56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ async def _get_html_content(self, message, body=None, msgtype="m.text"):
Return the json representation of the message in
"org.matrix.custom.html" format
"""
clean_markdown = clean(message)
html = markdown.markdown(message)
clean_html = clean(html)
clean_html = clean(message)

# Markdown leaves a <p></p> around standard messages that we want to strip:
if clean_html.startswith('<p>'):
Expand All @@ -166,7 +164,7 @@ async def _get_html_content(self, message, body=None, msgtype="m.text"):

return {
# Strip out any tags from the markdown to make the body
"body": body if body else re.sub('<[^<]+?>', '', clean_markdown),
"body": body if body else re.sub('<[^<]+?>', '', clean_html),
"msgtype": msgtype,
"format": "org.matrix.custom.html",
"formatted_body": clean_html
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
matrix_client>=0.0.5
bleach
markdown

0 comments on commit ddb0e56

Please sign in to comment.