Waylan Limberg  committed c935557

Fixed Ticket 38. With smart_emphasis turned on, emphasised text can now be wrapped in punctuation without spaces and still will be converted to emphasis (ie: '[_foo_]'). Test included. Thanks for the report seanh.

  • Participants
  • Parent commits 40ff4fa
  • Branches default

Comments (0)

Files changed (3)

File markdown/

 STRONG_EM_RE = r'(\*{3}|_{3})(.+?)\2'            # ***strong***
 if markdown.SMART_EMPHASIS:
-    EMPHASIS_2_RE = r'(?<!\S)(_)(\S.+?)\2'        # _emphasis_
+    EMPHASIS_2_RE = r'(?<!\w)(_)(\S.+?)\2(?!\w)'        # _emphasis_
     EMPHASIS_2_RE = r'(_)(.+?)\2'                 # _emphasis_

File tests/misc/smart_em.html

+<p>[<em>punctuation with emphasis</em>]</p>

File tests/misc/smart_em.txt

+[_punctuation with emphasis_]