From 2edd84eac6d419f7a20f779fbe120dd76ca195a8 Mon Sep 17 00:00:00 2001 From: Yuri Takhteyev Date: Tue, 1 Jul 2008 23:24:50 -0700 Subject: Switching to simpler non-printable placeholders. --- markdown.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/markdown.py b/markdown.py index 0b1e325..b141757 100644 --- a/markdown.py +++ b/markdown.py @@ -110,9 +110,8 @@ EXECUTABLE_NAME_FOR_USAGE = "python markdown.py" # a template for html placeholders START = u'\u0001' END = u'\u0002' -NULL = u'\u0001' -HTML_PLACEHOLDER_PREFIX = START+"html"+NULL -HTML_PLACEHOLDER = HTML_PLACEHOLDER_PREFIX + "%d"+END+"html"+NULL +HTML_PLACEHOLDER_PREFIX = START+"html:" +HTML_PLACEHOLDER = HTML_PLACEHOLDER_PREFIX + "%d"+END BLOCK_LEVEL_ELEMENTS = ['p', 'div', 'blockquote', 'pre', 'table', 'dl', 'ol', 'ul', 'script', 'noscript', @@ -1955,8 +1954,8 @@ class Markdown: # Fixup the source text - for controlChar in (START, END, NULL) : - self.source = self.source.replace(controlChar, "") + self.source = self.source.replace(START, "") + self.source = self.source.replace(END, "") self.source = self.source.replace("\r\n", "\n").replace("\r", "\n") self.source += "\n\n" -- cgit v1.2.3