aboutsummaryrefslogtreecommitdiffstats
path: root/markdown.py
diff options
context:
space:
mode:
authorArtem Yunusov <nedrlab@gmail.com>2008-07-16 15:36:25 +0500
committerArtem Yunusov <nedrlab@gmail.com>2008-07-16 15:36:25 +0500
commitd1134b2c547c471d85b443404904461941d27d71 (patch)
treebd22526990788fda16da7134ac12b47013080fc8 /markdown.py
parent57539d69e8ee1e86bd14c9e51273e576b2e38438 (diff)
downloadmarkdown-d1134b2c547c471d85b443404904461941d27d71.tar.gz
markdown-d1134b2c547c471d85b443404904461941d27d71.tar.bz2
markdown-d1134b2c547c471d85b443404904461941d27d71.zip
Ticket #5, backtick regexp change.
Diffstat (limited to 'markdown.py')
-rw-r--r--markdown.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/markdown.py b/markdown.py
index d1ffce6..dcfe18e 100644
--- a/markdown.py
+++ b/markdown.py
@@ -507,7 +507,7 @@ BRK = ( r'\[('
+ NOBRACKET + r')\]' )
NOIMG = r'(?<!\!)'
-BACKTICK_RE = r'([^\\])\`([^\`]*[^\\]{0,1})\`' # `e= m*c^2`
+BACKTICK_RE = r'(?<!\\)(?:`+)(?!`)(.+?)(?<!`)(`+)(?!`)'
DOUBLE_BACKTICK_RE = r'\`\`(.*?)\`\`' # ``e=f("`")``
ESCAPE_RE = r'\\(.)' # \<
EMPHASIS_RE = r'\*([^\*]*)\*' # *emphasis*
@@ -791,7 +791,7 @@ class AutomailPattern (Pattern):
ESCAPE_PATTERN = SimpleTextPattern(ESCAPE_RE)
NOT_STRONG_PATTERN = SimpleTextPattern(NOT_STRONG_RE)
-BACKTICK_PATTERN = BacktickPattern(BACKTICK_RE, 3)
+BACKTICK_PATTERN = BacktickPattern(BACKTICK_RE)
DOUBLE_BACKTICK_PATTERN = BacktickPattern(DOUBLE_BACKTICK_RE)
STRONG_PATTERN = SimpleTagPattern(STRONG_RE, 'strong')
STRONG_PATTERN_2 = SimpleTagPattern(STRONG_2_RE, 'strong')
@@ -1277,7 +1277,7 @@ class Markdown:
def _transform(self):
"""Transform the Markdown text into a XHTML body document.
- Returns: A NanoDom Document
+ Returns: ElementTree object
"""
@@ -1331,7 +1331,7 @@ class Markdown:
Keyword arguments:
- * parent_elem: A NanoDom element to which the content will be added.
+ * parent_elem: A ElementTree element to which the content will be added.
* lines: a list of lines
* inList: a level