diff --git a/botogram/syntaxes.py b/botogram/syntaxes.py index a570088..7add430 100644 --- a/botogram/syntaxes.py +++ b/botogram/syntaxes.py @@ -9,15 +9,15 @@ import re -_markdown_re = re.compile(r"(" +_markdown_re = re.compile(r".*(" r"\*(.*)\*|" r"_(.*)_|" r"\[(.*)\]\((.*)\)|" r"`(.*)`|" r"```(.*)```" - r")") + r").*") -_html_re = re.compile(r"(" +_html_re = re.compile(r".*(" r"(.*)<\/b>|" r"(.*)<\/strong>|" r"(.*)<\/i>|" @@ -25,7 +25,7 @@ r"(.*)<\/a>|" r"(.*)<\/code>|" r"
(.*)<\/pre>"
-                      r")")
+                      r").*")
 
 
 def is_markdown(message):
diff --git a/tests/test_syntaxes.py b/tests/test_syntaxes.py
index 3b28ffa..60775d0 100644
--- a/tests/test_syntaxes.py
+++ b/tests/test_syntaxes.py
@@ -16,8 +16,10 @@ def test_is_markdown():
 
     for delimiter in "*", "_", "`", "```":
         assert botogram.syntaxes.is_markdown(delimiter+"a"+delimiter)
+        assert botogram.syntaxes.is_markdown("!"+delimiter+"a"+delimiter+"!")
 
     assert botogram.syntaxes.is_markdown("[a](b)")
+    assert botogram.syntaxes.is_markdown("![a](b)!")
 
 
 def test_is_html():
@@ -26,10 +28,12 @@ def test_is_html():
 
     for tag in "b", "strong", "i", "em", "pre", "code":
         assert botogram.syntaxes.is_html("<"+tag+">a")
+        assert botogram.syntaxes.is_html("!<"+tag+">a!")
 
     assert not botogram.syntaxes.is_html("a")
     assert not botogram.syntaxes.is_html("a")
     assert botogram.syntaxes.is_html("a")
+    assert botogram.syntaxes.is_html("!a!")
 
 
 def test_guess_syntax():