diff options
| author | Waylan Limberg <waylan@gmail.com> | 2010-07-06 16:30:11 -0400 |
|---|---|---|
| committer | Waylan Limberg <waylan@gmail.com> | 2010-07-06 16:30:11 -0400 |
| commit | 018aa73e82941288a1178ded751cf29d9bc13581 (patch) | |
| tree | 38a87c7f51eddf389fb0455c112e7bbb6bbf448a /markdown/inlinepatterns.py | |
| parent | 03bf339b594db40592d3a4848ec1e5402a371df2 (diff) | |
| download | python-markdown-018aa73e82941288a1178ded751cf29d9bc13581.tar.gz | |
Moved a bunch of global variables to the instance of the Markdown class.
Diffstat (limited to 'markdown/inlinepatterns.py')
| -rw-r--r-- | markdown/inlinepatterns.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/markdown/inlinepatterns.py b/markdown/inlinepatterns.py index ceeef0a..a718b7e 100644 --- a/markdown/inlinepatterns.py +++ b/markdown/inlinepatterns.py @@ -67,12 +67,8 @@ ESCAPE_RE = r'\\(.)' # \< EMPHASIS_RE = r'(\*)([^\*]+)\2' # *emphasis* STRONG_RE = r'(\*{2}|_{2})(.+?)\2' # **strong** STRONG_EM_RE = r'(\*{3}|_{3})(.+?)\2' # ***strong*** - -if util.SMART_EMPHASIS: - EMPHASIS_2_RE = r'(?<!\w)(_)(\S.+?)\2(?!\w)' # _emphasis_ -else: - EMPHASIS_2_RE = r'(_)(.+?)\2' # _emphasis_ - +SMART_EMPHASIS_RE = r'(?<!\w)(_)(\S.+?)\2(?!\w)' # _smart_emphasis_ +EMPHASIS_2_RE = r'(_)(.+?)\2' # _emphasis_ LINK_RE = NOIMG + BRK + \ r'''\(\s*(<.*?>|((?:(?:\(.*?\))|[^\(\)]))*?)\s*((['"])(.*?)\12)?\)''' # [text](url) or [text](<url>) @@ -287,7 +283,7 @@ class ImagePattern(LinkPattern): if len(src_parts) > 1: el.set('title', dequote(" ".join(src_parts[1:]))) - if util.ENABLE_ATTRIBUTES: + if self.markdown.ENABLE_ATTRIBUTES: truealt = handleAttributes(m.group(2), el) else: truealt = m.group(2) |
