Commits

David Chambers committed b6cbb3f

Added code to handle backslashes in documents. Removed << and >> replacements (too problematic).

  • Participants
  • Parent commits d1bd40c

Comments (0)

Files changed (2)

File examples/4=>mango-markdown-syntax.text

 **Note:** Like all mango powered documents the markdown [source]('./m/') code for this can be seen by
 adding 'm/' to the end of the url
 
-Chevrons???
------------
-
-"\<<" and "\>>" are both replaced by "<<" and ">>" in Mango, allowing the easy use of <<them>>. Escape
-with a "\\".
-
 Excerpt
 -------
 
     'inline': re.compile(r'(\[[^\]]+\]\(/(?P<path>\S+?)\)\s*){{\s*filesize\s*}}'),
     'ref-style': re.compile(r'(\[(?P<id>[^\]]+)\]\s*){{\s*filesize\s*}}'),
     'replacements': (
-        (re.compile(r'(?<!\\)\.\.\.(?!\.)'), u'\u2026'),     # ... -> ellipsis
-        (re.compile(r' -- '), u'\u2009\u2014\u2009'),        # [space][hyphen][hyphen][space] -> [thin space][em dash][thin space]
-        (re.compile(r'(?<!\\)&lt;&lt;(?!&lt;)'), u'\u00AB'), # << -> «
-        (re.compile(r'(?<!\\)&gt;&gt;(?!&gt;)'), u'\u00BB'), # >> -> »
+        # ... -> ellipsis
+        (re.compile(r'(?<![.])[.]{3}(?![.])'), u'\u2026'),
+        # [space][hyphen][hyphen][space] -> [thin space][em dash][thin space]
+        (re.compile(r' -- '), u'\u2009\u2014\u2009'),
     ),
     'snippet': re.compile(r'(?s)^<(code|pre)>.*?</\1>$'),
     'update': re.compile(block % r'\|\|'),
                 lambda m: m.group(1) + print_filesize(m.group('path'), plaintext=plaintext), self.body)
 
         # don't touch self.body beyond this point
-        body = self.body
+        body = self.body.replace('\\', r'\\') # double up literal backslashes
 
         # excerpts
         snippets = []