aboutsummaryrefslogtreecommitdiffstats
path: root/tests2/formatter.py
diff options
context:
space:
mode:
authorArtem Yunusov <nedrlab@gmail.com>2008-08-01 02:58:48 +0500
committerArtem Yunusov <nedrlab@gmail.com>2008-08-01 02:58:48 +0500
commit13d25f86f61bbce247a12b845c3675b57274a13e (patch)
treecb8affc75b6715b87cda1f6a495a66a48ef4e79e /tests2/formatter.py
parentbd185087dc899b6157f821fdd29561caffcc4682 (diff)
downloadmarkdown-13d25f86f61bbce247a12b845c3675b57274a13e.tar.gz
markdown-13d25f86f61bbce247a12b845c3675b57274a13e.tar.bz2
markdown-13d25f86f61bbce247a12b845c3675b57274a13e.zip
Some cleanups.
Diffstat (limited to 'tests2/formatter.py')
-rw-r--r--tests2/formatter.py55
1 files changed, 0 insertions, 55 deletions
diff --git a/tests2/formatter.py b/tests2/formatter.py
deleted file mode 100644
index 26d850f..0000000
--- a/tests2/formatter.py
+++ /dev/null
@@ -1,55 +0,0 @@
-from __future__ import with_statement
-import os
-
-excl_tm_cases = """basic_safe_mode
-basic_safe_mode_escape
-auto_link_safe_mode
-code_safe_emphasis
-emacs_head_vars
-emacs_tail_vars
-footnotes
-footnotes_letters
-footnotes_markup
-footnotes_safe_mode_escape
-nested_list_safe_mode
-issue2_safe_mode_borks_markup
-issue3_bad_code_color_hack
-link_defn_spaces_in_url
-link_patterns
-link_patterns_double_hit
-link_patterns_edge_cases
-mismatched_footnotes
-nested_lists_safe_mode
-pyshell
-syntax_color"""
-
-
-def reformat(path, dest, ex=""):
- excl = ex.split("\n")
- for fname in os.listdir(path):
- if fname.endswith(".html"):
- if fname[:-5] in excl:
- continue
- res = processFile(path + fname)
- with open(dest + fname, "w") as rfile:
- rfile.write(res)
-
-def processFile(filePath):
- with open(filePath) as f:
- result = f.read()
- result = result.replace("</pre>\n\n<p>", "</pre><p>")
- result = result.replace("</pre>\n<", "</pre><")
- result = result.replace("</li>", "\n</li>")
- result = result.replace("<li>", "<li>\n")
- result = result.replace(">\n<p>", "><p>")
- result = result.replace("\" />", "\"/>")
- result = result.replace("</p>\n", "\n</p>\n")
-
- return result
-
-if __name__ == "__main__":
- reformat("php-markdown-cases/", "php-markdown-cases-new/")
- reformat("tm-cases/", "tm-cases-new/", excl_tm_cases)
-
-
- \ No newline at end of file