diff options
author | Waylan Limberg <waylan@gmail.com> | 2007-11-03 20:24:53 +0000 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2007-11-03 20:24:53 +0000 |
commit | 5982780c3cc46f18dd3bd93022d61feb2972a843 (patch) | |
tree | 451fb13f6b882b9138c1e991e34d0a97caae4eeb | |
parent | 552bd256be6e710766062489132d9ab7ba756b37 (diff) | |
download | markdown-5982780c3cc46f18dd3bd93022d61feb2972a843.tar.gz markdown-5982780c3cc46f18dd3bd93022d61feb2972a843.tar.bz2 markdown-5982780c3cc46f18dd3bd93022d61feb2972a843.zip |
Allow repeated calls to md.convert to pass in an empty string. Also fixed testing framework to allow tests for this and added tests. Fixes [1825231]
-rw-r--r-- | markdown.py | 2 | ||||
-rw-r--r-- | test-markdown.py | 4 | ||||
-rw-r--r-- | tests/misc/blank.html | 0 | ||||
-rw-r--r-- | tests/misc/blank.txt | 0 |
4 files changed, 3 insertions, 3 deletions
diff --git a/markdown.py b/markdown.py index 181de1d..116a974 100644 --- a/markdown.py +++ b/markdown.py @@ -1628,7 +1628,7 @@ class Markdown: @returns: A serialized XHTML body.""" #try : - if source : + if source is not None: #Allow blank string self.source = source if not self.source : diff --git a/test-markdown.py b/test-markdown.py index b9f5cdf..94fdda4 100644 --- a/test-markdown.py +++ b/test-markdown.py @@ -232,7 +232,7 @@ def testDirectory(dir, measure_time = False) : actual_output = "" actual_lines = [] - md.source = "" + #md.source = "" gc.collect() mem = memory() t = time.clock() @@ -348,7 +348,7 @@ markdown = __import__(MARKDOWN_FILE) #testDirectory("tests/basic") -#testDirectory("tests/markdown-test", measure_time=True) +testDirectory("tests/markdown-test", measure_time=True) testDirectory("tests/misc", measure_time=True) #testDirectory("tests/extensions-x-footnotes-toc") diff --git a/tests/misc/blank.html b/tests/misc/blank.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/misc/blank.html diff --git a/tests/misc/blank.txt b/tests/misc/blank.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/misc/blank.txt |