Commits

Anonymous committed b959254

links and images don't need closing

Comments (0)

Files changed (2)

+Version 0.?.? (Nov ?? 2007)
+---------------------------
+
+ * links don't have to close! (makes them more robust)
+
+
 Version 0.2.1 (Nov 6 2007)
 --------------------------
 

creoleparser/elements.py

             return esc_neg_look + re.escape(self.token) + content + end
         else:
             content = '(.+?)'
-            return esc_neg_look + re.escape(self.token[0]) + content + esc_neg_look + re.escape(self.token[1])
+            return esc_neg_look + re.escape(self.token[0]) +\
+                   content + '(' + esc_neg_look + re.escape(self.token[1]) +\
+                   r'|$)'
              
 
 class Link(InlineElement):
     def pre_escape_pattern(self):
         return '(' + re.escape(self.token[0]) + '.*?)' + \
                '(' + re.escape(self.delimiter) + '.*?' + \
-               re.escape(self.token[1]) + ')'
+               '(' + re.escape(self.token[1]) + '|$))'
         
     def _build(self,mo):
         body = mo.group(1).split(escape_char + self.delimiter, 1)
     def pre_escape_pattern(self):
         return '(' + re.escape(self.token[0]) + '.*?)' + \
                '(' + re.escape(self.delimiter) + '.*?' + \
-               re.escape(self.token[1]) + ')'
+               '(' + re.escape(self.token[1]) + '|$))'
 
     def _build(self,mo):
         body = mo.group(1).split(escape_char+self.delimiter,1)