diff -Nru python-markdown-2.1.0/debian/changelog python-markdown-2.1.1/debian/changelog --- python-markdown-2.1.0/debian/changelog 2012-01-22 11:58:28.000000000 +0000 +++ python-markdown-2.1.1/debian/changelog 2012-01-25 21:49:11.000000000 +0000 @@ -1,3 +1,12 @@ +python-markdown (2.1.1-1) unstable; urgency=low + + * Add myself to Uploaders + * New upstream release + * Add debian/markdown_py.1 manpage + * Drop 01-fix-unusual-interpreter.patch, fixed upstream + + -- Dmitry Shachnev Wed, 25 Jan 2012 13:26:18 +0400 + python-markdown (2.1.0-1) unstable; urgency=low [ Dmitry Shachnev ] diff -Nru python-markdown-2.1.0/debian/control python-markdown-2.1.1/debian/control --- python-markdown-2.1.0/debian/control 2012-01-13 01:32:49.000000000 +0000 +++ python-markdown-2.1.1/debian/control 2012-01-25 21:49:11.000000000 +0000 @@ -2,7 +2,8 @@ Section: python Priority: optional Maintainer: Debian Python Modules Team -Uploaders: Fredrik Steen , Bernd Zeimetz +Uploaders: Fredrik Steen , Bernd Zeimetz , + Dmitry Shachnev Build-Depends: debhelper (>= 7.0.50~), python-all (>= 2.6.6-3~), python3-all (>= 3.1.2-7~) Standards-Version: 3.9.2 Homepage: http://www.freewisdom.org/projects/python-markdown/ diff -Nru python-markdown-2.1.0/debian/markdown_py.1 python-markdown-2.1.1/debian/markdown_py.1 --- python-markdown-2.1.0/debian/markdown_py.1 1970-01-01 00:00:00.000000000 +0000 +++ python-markdown-2.1.1/debian/markdown_py.1 2012-01-25 21:49:11.000000000 +0000 @@ -0,0 +1,50 @@ +.TH MARKDOWN_PY 1 + +.SH NAME +markdown_py \- a Python implementation of John Gruber's Markdown. + +.SH SYNOPSIS +.B markdown_py [\fIoptions\fR] [\fIINPUT_FILE\fR] +.RS 0 +(STDIN is assumed if no INPUT_FILE is given) + +.SH OPTIONS +.TP +\fB--version\fR +Show program's version number and exit. +.TP +\fB-h\fR, \fB--help\fR +Show this help message and exit. +.TP +\fB-f \fIOUTPUT_FILE\fR, \fB--file=\fIOUTPUT_FILE\fR +Write output to OUTPUT_FILE. Defaults to STDOUT. +.TP +\fB-e \fIENCODING\fR, \fB--encoding=\fIENCODING\fR +Encoding for input and output files. +.TP +\fB-q\fR, \fB--quiet\fR +Suppress all warnings. +.TP +\fB-v\fR, \fB--verbose\fR +Print all warnings. +.TP +\fB-s \fISAFE_MODE\fR, \fB--safe=\fISAFE_MODE\fR +\'replace\', \'remove\' or \'escape\' HTML tags in input. +.TP +\fB-o \fIOUTPUT_FORMAT\fR, \fB--output_format=\fIOUTPUT_FORMAT\fR +\'xhtml1\' (default), \'html4\' or \'html5\'. +.TP +\fB--noisy\fR +Print debug messages. +.TP +\fB-x \fIEXTENSION\fR, \fB--extension=\fIEXTENSION\fR +Load extension EXTENSION. +.TP +\fB-n\fR, \fB--no_lazy_ol\fR +Observe number of first item of ordered lists. + +.SH DESCRIPTION +Command-line Markdown compiler based on python-markdown module, with extensions support. + +.SH AUTHOR +This manual page was written by Dmitry Shachnev . diff -Nru python-markdown-2.1.0/debian/patches/01-fix-unusual-interpreter.patch python-markdown-2.1.1/debian/patches/01-fix-unusual-interpreter.patch --- python-markdown-2.1.0/debian/patches/01-fix-unusual-interpreter.patch 2012-01-22 11:58:28.000000000 +0000 +++ python-markdown-2.1.1/debian/patches/01-fix-unusual-interpreter.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -Description: Fix wrong capitalization in def_list and tables extensions -Author: Dmitry Shachnev, 2012 - -Index: python-markdown_2.1.0/markdown/extensions/def_list.py -=================================================================== ---- python-markdown_2.1.0.orig/markdown/extensions/def_list.py 2012-01-22 15:16:18.314922895 +0400 -+++ python-markdown_2.1.0/markdown/extensions/def_list.py 2012-01-22 15:15:40.258924453 +0400 -@@ -1,4 +1,4 @@ --#!/usr/bin/env Python -+#!/usr/bin/env python - """ - Definition List Extension for Python-Markdown - ============================================= -Index: python-markdown_2.1.0/markdown/extensions/tables.py -=================================================================== ---- python-markdown_2.1.0.orig/markdown/extensions/tables.py 2012-01-22 15:16:18.194922900 +0400 -+++ python-markdown_2.1.0/markdown/extensions/tables.py 2012-01-22 15:15:43.734924310 +0400 -@@ -1,4 +1,4 @@ --#!/usr/bin/env Python -+#!/usr/bin/env python - """ - Tables Extension for Python-Markdown - ==================================== diff -Nru python-markdown-2.1.0/debian/patches/series python-markdown-2.1.1/debian/patches/series --- python-markdown-2.1.0/debian/patches/series 2012-01-22 11:58:28.000000000 +0000 +++ python-markdown-2.1.1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -01-fix-unusual-interpreter.patch diff -Nru python-markdown-2.1.0/debian/python-markdown.manpages python-markdown-2.1.1/debian/python-markdown.manpages --- python-markdown-2.1.0/debian/python-markdown.manpages 1970-01-01 00:00:00.000000000 +0000 +++ python-markdown-2.1.1/debian/python-markdown.manpages 2012-01-25 21:49:11.000000000 +0000 @@ -0,0 +1 @@ +debian/markdown_py.1 diff -Nru python-markdown-2.1.0/debian/rules python-markdown-2.1.1/debian/rules --- python-markdown-2.1.0/debian/rules 2012-01-13 01:32:49.000000000 +0000 +++ python-markdown-2.1.1/debian/rules 2012-01-25 21:49:11.000000000 +0000 @@ -15,9 +15,9 @@ find -name '*.pyo' -exec rm -f {} \; override_dh_auto_install: - dh_auto_install - set -ex && for python in $(PYTHON3); do \ - python$$python setup.py install --install-layout=deb --root=debian/tmp; \ + set -ex && for pyversion in $(PYTHON3); do \ + python$$pyversion setup.py install --install-layout=deb --root=debian/tmp; \ done + dh_auto_install .PHONY: override_dh_auto_clean override_dh_installchangelogs override_dh_auto_install diff -Nru python-markdown-2.1.0/docs/CHANGE_LOG python-markdown-2.1.1/docs/CHANGE_LOG --- python-markdown-2.1.0/docs/CHANGE_LOG 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/docs/CHANGE_LOG 2012-01-22 18:34:40.000000000 +0000 @@ -1,6 +1,10 @@ PYTHON MARKDOWN CHANGELOG ========================= +Nov 24, 2011: Released version 2.1.0-Final. + +Oct 7, 2009: Released version 2.0.3-Final. + Sept 28, 2009: Released version 2.0.2-Final. May 20, 2009: Released version 2.0.1-Final. diff -Nru python-markdown-2.1.0/docs/release-2.1.1.md python-markdown-2.1.1/docs/release-2.1.1.md --- python-markdown-2.1.0/docs/release-2.1.1.md 1970-01-01 00:00:00.000000000 +0000 +++ python-markdown-2.1.1/docs/release-2.1.1.md 2012-01-22 18:48:37.000000000 +0000 @@ -0,0 +1,7 @@ +Python-Markdown 2.1.1 Release Notes +=================================== + +Python-Markdown 2.1.1 is a bug-fix release. No new features have been added. +Most notably, a bug which caused raw HTML paring to run __very__ slowly has +been fixed along with a few bugs which caused the parser to raise exceptions +while parsing. For a full list of changes, see the git log. diff -Nru python-markdown-2.1.0/markdown/extensions/codehilite.py python-markdown-2.1.1/markdown/extensions/codehilite.py --- python-markdown-2.1.0/markdown/extensions/codehilite.py 2011-07-22 21:26:54.000000000 +0000 +++ python-markdown-2.1.1/markdown/extensions/codehilite.py 2012-01-22 18:34:40.000000000 +0000 @@ -216,7 +216,7 @@ """ Add HilitePostprocessor to Markdown instance. """ hiliter = HiliteTreeprocessor(md) hiliter.config = self.getConfigs() - md.treeprocessors.add("hilite", hiliter, "_begin") + md.treeprocessors.add("hilite", hiliter, "# Some python code +Optionally backticks instead of tildes as per how github's code block markdown is identified: + + >>> text = ''' + ... ````` + ... # Arbitrary code + ... ~~~~~ # these tildes will not close the block + ... `````''' + >>> print markdown.markdown(text, extensions=['fenced_code']) +
# Arbitrary code
+    ~~~~~ # these tildes will not close the block
+    
+ Copyright 2007-2008 [Waylan Limberg](http://achinghead.com/). Project website: @@ -69,7 +81,7 @@ # Global vars FENCED_BLOCK_RE = re.compile( \ - r'(?P^~{3,})[ ]*(\{?\.(?P[a-zA-Z0-9_-]*)\}?)?[ ]*\n(?P.*?)(?P=fence)[ ]*$', + r'(?P^(?:~{3,}|`{3,}))[ ]*(\{?\.?(?P[a-zA-Z0-9_-]*)\}?)?[ ]*\n(?P.*?)(?<=\n)(?P=fence)[ ]*$', re.MULTILINE|re.DOTALL ) CODE_WRAP = '
%s
' @@ -118,12 +130,12 @@ # is enabled, so we call it to highlite the code if self.codehilite_conf: highliter = CodeHilite(m.group('code'), - linenos=self.codehilite_conf['force_linenos'], - guess_lang=self.codehilite_conf['guess_lang'], - css_class=self.codehilite_conf['css_class'], - style=self.codehilite_conf['pygments_style'], + linenos=self.codehilite_conf['force_linenos'][0], + guess_lang=self.codehilite_conf['guess_lang'][0], + css_class=self.codehilite_conf['css_class'][0], + style=self.codehilite_conf['pygments_style'][0], lang=(m.group('lang') or None), - noclasses=self.codehilite_conf['noclasses']) + noclasses=self.codehilite_conf['noclasses'][0]) code = highliter.hilite() else: diff -Nru python-markdown-2.1.0/markdown/extensions/footnotes.py python-markdown-2.1.1/markdown/extensions/footnotes.py --- python-markdown-2.1.0/markdown/extensions/footnotes.py 2011-11-18 03:51:09.000000000 +0000 +++ python-markdown-2.1.1/markdown/extensions/footnotes.py 2012-01-22 18:34:40.000000000 +0000 @@ -43,7 +43,11 @@ 'UNIQUE_IDS': [False, "Avoid name collisions across " - "multiple calls to reset()."]} + "multiple calls to reset()."], + "BACKLINK_TEXT": + ["↩", + "The text string that links from the footnote to the reader's place."] + } for key, value in configs: self.config[key][0] = value @@ -65,10 +69,10 @@ md.inlinePatterns.add("footnote", FootnotePattern(FOOTNOTE_RE, self), "amp_substitute") @@ -282,9 +286,11 @@ class FootnotePostprocessor(markdown.postprocessors.Postprocessor): """ Replace placeholders with html entities. """ + def __init__(self, footnotes): + self.footnotes = footnotes def run(self, text): - text = text.replace(FN_BACKLINK_TEXT, "↩") + text = text.replace(FN_BACKLINK_TEXT, self.footnotes.getConfig("BACKLINK_TEXT")) return text.replace(NBSP_PLACEHOLDER, " ") def makeExtension(configs=[]): diff -Nru python-markdown-2.1.0/markdown/extensions/tables.py python-markdown-2.1.1/markdown/extensions/tables.py --- python-markdown-2.1.0/markdown/extensions/tables.py 2011-07-22 21:26:54.000000000 +0000 +++ python-markdown-2.1.1/markdown/extensions/tables.py 2012-01-19 02:19:47.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/bin/env Python +#!/usr/bin/env python """ Tables Extension for Python-Markdown ==================================== diff -Nru python-markdown-2.1.0/markdown/__init__.py python-markdown-2.1.1/markdown/__init__.py --- python-markdown-2.1.0/markdown/__init__.py 2011-11-24 20:03:12.000000000 +0000 +++ python-markdown-2.1.1/markdown/__init__.py 2012-01-22 18:49:55.000000000 +0000 @@ -22,7 +22,7 @@ Contact: markdown@freewisdom.org -Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later) +Copyright 2007-2012 The Python Markdown Project (v. 1.7 and later) Copyright 200? Django Software Foundation (OrderedDict implementation) Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) Copyright 2004 Manfred Stienstra (the original version) @@ -30,8 +30,8 @@ License: BSD (see LICENSE for details). """ -version = "2.1.0" -version_info = (2,1,0, "final") +version = "2.1.1" +version_info = (2,1,1, "final") import re import codecs @@ -44,7 +44,7 @@ from inlinepatterns import build_inlinepatterns from postprocessors import build_postprocessors from extensions import Extension -from searializers import to_html_string, to_xhtml_string +from serializers import to_html_string, to_xhtml_string __all__ = ['Markdown', 'markdown', 'markdownFromFile'] @@ -117,7 +117,7 @@ # ignore any additional args break - # Loop throu kwargs and assign defaults + # Loop through kwargs and assign defaults for option, default in self.option_defaults.items(): setattr(self, option, kwargs.get(option, default)) @@ -148,7 +148,7 @@ """ Register extensions with this instance of Markdown. - Keyword aurguments: + Keyword arguments: * extensions: A list of extensions, which can either be strings or objects. See the docstring on Markdown. @@ -189,7 +189,7 @@ module_name_new_style = '.'.join([ext_module, ext_name]) module_name_old_style = '_'.join(['mdx', ext_name]) - # Try loading the extention first from one place, then another + # Try loading the extension first from one place, then another try: # New style (markdown.extensons.) module = __import__(module_name_new_style, {}, {}, [ext_module]) except ImportError: @@ -333,28 +333,38 @@ encoding = encoding or "utf-8" # Read the source - if isinstance(input, basestring): - input_file = codecs.open(input, mode="r", encoding=encoding) + if input: + if isinstance(input, str): + input_file = codecs.open(input, mode="r", encoding=encoding) + else: + input_file = codecs.getreader(encoding)(input) + text = input_file.read() + input_file.close() else: - input = input or sys.stdin - input_file = codecs.getreader(encoding)(input) - text = input_file.read() - input_file.close() - text = text.lstrip(u'\ufeff') # remove the byte-order mark + text = sys.stdin.read() + if not isinstance(text, unicode): + text = text.decode(encoding) + + text = text.lstrip('\ufeff') # remove the byte-order mark # Convert html = self.convert(text) # Write to file or stdout - if isinstance(output, basestring): - output_file = codecs.open(output, "w", - encoding=encoding, - errors="xmlcharrefreplace") - output_file.write(html) - output_file.close() + if output: + if isinstance(output, str): + output_file = codecs.open(output, "w", + encoding=encoding, + errors="xmlcharrefreplace") + output_file.write(html) + output_file.close() + else: + writer = codecs.getwriter(encoding) + output_file = writer(output, errors="xmlcharrefreplace") + output_file.write(html) + # Don't close here. User may want to write more. else: - output = output or sys.stdout - output.write(html.encode(encoding, "xmlcharrefreplace")) + sys.stdout.write(html) return self @@ -390,7 +400,7 @@ """Read markdown code from a file and write it to a file or a stream. This is a shortcut function which initializes an instance of Markdown, - cand calls the convertFile method rather than convert. + and calls the convertFile method rather than convert. Keyword arguments: @@ -400,7 +410,7 @@ * Any arguments accepted by the Markdown class. """ - # For backward compatability loop through positional args + # For backward compatibility loop through positional args pos = ['input', 'output', 'extensions', 'encoding'] c = 0 for arg in args: diff -Nru python-markdown-2.1.0/markdown/inlinepatterns.py python-markdown-2.1.1/markdown/inlinepatterns.py --- python-markdown-2.1.0/markdown/inlinepatterns.py 2011-10-11 01:23:52.000000000 +0000 +++ python-markdown-2.1.1/markdown/inlinepatterns.py 2012-01-22 18:34:40.000000000 +0000 @@ -71,7 +71,8 @@ inlinePatterns["automail"] = AutomailPattern(AUTOMAIL_RE, md_instance) inlinePatterns["linebreak2"] = SubstituteTagPattern(LINE_BREAK_2_RE, 'br') inlinePatterns["linebreak"] = SubstituteTagPattern(LINE_BREAK_RE, 'br') - inlinePatterns["html"] = HtmlPattern(HTML_RE, md_instance) + if md_instance.safeMode != 'escape': + inlinePatterns["html"] = HtmlPattern(HTML_RE, md_instance) inlinePatterns["entity"] = HtmlPattern(ENTITY_RE, md_instance) inlinePatterns["not_strong"] = SimpleTextPattern(NOT_STRONG_RE) inlinePatterns["strong_em"] = DoubleTagPattern(STRONG_EM_RE, 'strong,em') @@ -268,11 +269,27 @@ class HtmlPattern(Pattern): """ Store raw inline html and return a placeholder. """ def handleMatch (self, m): - rawhtml = m.group(2) - inline = True + rawhtml = self.unescape(m.group(2)) place_holder = self.markdown.htmlStash.store(rawhtml) return place_holder + def unescape(self, text): + """ Return unescaped text given text with an inline placeholder. """ + try: + stash = self.markdown.treeprocessors['inline'].stashed_nodes + except KeyError: + return text + def get_stash(m): + id = m.group(1) + value = stash.get(id) + if value is not None: + try: + return self.markdown.serializer(value) + except: + return '\%s' % value + + return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text) + class LinkPattern(Pattern): """ Return a link element from the given match. """ @@ -311,20 +328,29 @@ `username:password@host:port`. """ + if not self.markdown.safeMode: + # Return immediately bipassing parsing. + return url + + try: + scheme, netloc, path, params, query, fragment = url = urlparse(url) + except ValueError: + # Bad url - so bad it couldn't be parsed. + return '' + locless_schemes = ['', 'mailto', 'news'] - scheme, netloc, path, params, query, fragment = url = urlparse(url) - safe_url = False - if netloc != '' or scheme in locless_schemes: - safe_url = True + if netloc == '' and scheme not in locless_schemes: + # This fails regardless of anything else. + # Return immediately to save additional proccessing + return '' for part in url[2:]: if ":" in part: - safe_url = False + # Not a safe url + return '' - if self.markdown.safeMode and not safe_url: - return '' - else: - return urlunparse(url) + # Url passes all tests. Return url as-is. + return urlunparse(url) class ImagePattern(LinkPattern): """ Return a img element from the given match. """ diff -Nru python-markdown-2.1.0/markdown/__main__.py python-markdown-2.1.1/markdown/__main__.py --- python-markdown-2.1.0/markdown/__main__.py 2011-08-04 02:00:30.000000000 +0000 +++ python-markdown-2.1.1/markdown/__main__.py 2012-01-19 02:19:48.000000000 +0000 @@ -53,7 +53,7 @@ (options, args) = parser.parse_args() if len(args) == 0: - input_file = sys.stdin + input_file = None else: input_file = args[0] diff -Nru python-markdown-2.1.0/markdown/postprocessors.py python-markdown-2.1.1/markdown/postprocessors.py --- python-markdown-2.1.0/markdown/postprocessors.py 2011-08-23 14:23:25.000000000 +0000 +++ python-markdown-2.1.1/markdown/postprocessors.py 2012-01-19 04:50:34.000000000 +0000 @@ -49,7 +49,6 @@ """ Iterate over html stash and restore "safe" html. """ for i in range(self.markdown.htmlStash.html_counter): html, safe = self.markdown.htmlStash.rawHtmlBlocks[i] - html = self.unescape(html) if self.markdown.safeMode and not safe: if str(self.markdown.safeMode).lower() == 'escape': html = self.escape(html) @@ -65,13 +64,6 @@ html) return text - def unescape(self, html): - """ Unescape any markdown escaped text within inline html. """ - for k, v in self.markdown.treeprocessors['inline'].stashed_nodes.items(): - ph = util.INLINE_PLACEHOLDER % k - html = html.replace(ph, '\%s' % v) - return html - def escape(self, html): """ Basic html escaping """ html = html.replace('&', '&') @@ -79,7 +71,6 @@ html = html.replace('>', '>') return html.replace('"', '"') - def isblocklevel(self, html): m = re.match(r'^\<\/?([^ ]+)', html) if m: diff -Nru python-markdown-2.1.0/markdown/preprocessors.py python-markdown-2.1.1/markdown/preprocessors.py --- python-markdown-2.1.0/markdown/preprocessors.py 2011-07-22 21:26:54.000000000 +0000 +++ python-markdown-2.1.1/markdown/preprocessors.py 2012-01-19 03:51:05.000000000 +0000 @@ -14,7 +14,8 @@ def build_preprocessors(md_instance, **kwargs): """ Build the default set of preprocessors used by Markdown. """ preprocessors = odict.OrderedDict() - preprocessors["html_block"] = HtmlBlockPreprocessor(md_instance) + if md_instance.safeMode != 'escape': + preprocessors["html_block"] = HtmlBlockPreprocessor(md_instance) preprocessors["reference"] = ReferencePreprocessor(md_instance) return preprocessors @@ -78,7 +79,7 @@ attrs[ma.group('attr2').strip()] = "" return tag, len(m.group(0)), attrs else: - tag = block[1:].replace(">", " ", 1).split()[0].lower() + tag = block[1:].split(">", 1)[0].lower() return tag, len(tag)+2, {} def _recursive_tagfind(self, ltag, rtag, start_index, block): @@ -143,21 +144,20 @@ if not in_tag: if block.startswith("<") and len(block.strip()) > 1: - left_tag, left_index, attrs = self._get_left_tag(block) - right_tag, data_index = self._get_right_tag(left_tag, - left_index, - block) if block[1] == "!": # is a comment block - left_tag = "--" - right_tag, data_index = self._get_right_tag(left_tag, - left_index, - block) - # keep checking conditions below and maybe just append + left_tag, left_index, attrs = "--", 2, () + else: + left_tag, left_index, attrs = self._get_left_tag(block) + right_tag, data_index = self._get_right_tag(left_tag, + left_index, + block) + # keep checking conditions below and maybe just append if data_index < len(block) \ - and util.isBlockLevel(left_tag): + and (util.isBlockLevel(left_tag) + or left_tag == '--'): text.insert(0, block[data_index:]) block = block[:data_index] @@ -204,12 +204,16 @@ else: items.append(block) - right_tag, data_index = self._get_right_tag(left_tag, - left_index, - block) + right_tag, data_index = self._get_right_tag(left_tag, 0, block) if self._equal_tags(left_tag, right_tag): # if find closing tag + + if data_index < len(block): + # we have more text after right_tag + items[-1] = block[:data_index] + text.insert(0, block[data_index:]) + in_tag = False if self.markdown_in_raw and 'markdown' in attrs.keys(): start = re.sub(r'\smarkdown(=[\'"]?[^> ]*[\'"]?)?', diff -Nru python-markdown-2.1.0/markdown/searializers.py python-markdown-2.1.1/markdown/searializers.py --- python-markdown-2.1.0/markdown/searializers.py 2011-07-29 01:53:22.000000000 +0000 +++ python-markdown-2.1.1/markdown/searializers.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,275 +0,0 @@ -# markdown/searializers.py -# -# Add x/html serialization to Elementree -# Taken from ElementTree 1.3 preview with slight modifications -# -# Copyright (c) 1999-2007 by Fredrik Lundh. All rights reserved. -# -# fredrik@pythonware.com -# http://www.pythonware.com -# -# -------------------------------------------------------------------- -# The ElementTree toolkit is -# -# Copyright (c) 1999-2007 by Fredrik Lundh -# -# By obtaining, using, and/or copying this software and/or its -# associated documentation, you agree that you have read, understood, -# and will comply with the following terms and conditions: -# -# Permission to use, copy, modify, and distribute this software and -# its associated documentation for any purpose and without fee is -# hereby granted, provided that the above copyright notice appears in -# all copies, and that both that copyright notice and this permission -# notice appear in supporting documentation, and that the name of -# Secret Labs AB or the author not be used in advertising or publicity -# pertaining to distribution of the software without specific, written -# prior permission. -# -# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD -# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- -# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR -# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY -# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE -# OF THIS SOFTWARE. -# -------------------------------------------------------------------- - - -import util -ElementTree = util.etree.ElementTree -QName = util.etree.QName -if hasattr(util.etree, 'test_comment'): - Comment = util.etree.test_comment -else: - Comment = util.etree.Comment -PI = util.etree.PI -ProcessingInstruction = util.etree.ProcessingInstruction - -__all__ = ['to_html_string', 'to_xhtml_string'] - -HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr", - "img", "input", "isindex", "link", "meta" "param") - -try: - HTML_EMPTY = set(HTML_EMPTY) -except NameError: - pass - -_namespace_map = { - # "well-known" namespace prefixes - "http://www.w3.org/XML/1998/namespace": "xml", - "http://www.w3.org/1999/xhtml": "html", - "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", - "http://schemas.xmlsoap.org/wsdl/": "wsdl", - # xml schema - "http://www.w3.org/2001/XMLSchema": "xs", - "http://www.w3.org/2001/XMLSchema-instance": "xsi", - # dublic core - "http://purl.org/dc/elements/1.1/": "dc", -} - - -def _raise_serialization_error(text): - raise TypeError( - "cannot serialize %r (type %s)" % (text, type(text).__name__) - ) - -def _encode(text, encoding): - try: - return text.encode(encoding, "xmlcharrefreplace") - except (TypeError, AttributeError): - _raise_serialization_error(text) - -def _escape_cdata(text): - # escape character data - try: - # it's worth avoiding do-nothing calls for strings that are - # shorter than 500 character, or so. assume that's, by far, - # the most common case in most applications. - if "&" in text: - text = text.replace("&", "&") - if "<" in text: - text = text.replace("<", "<") - if ">" in text: - text = text.replace(">", ">") - return text - except (TypeError, AttributeError): - _raise_serialization_error(text) - - -def _escape_attrib(text): - # escape attribute value - try: - if "&" in text: - text = text.replace("&", "&") - if "<" in text: - text = text.replace("<", "<") - if ">" in text: - text = text.replace(">", ">") - if "\"" in text: - text = text.replace("\"", """) - if "\n" in text: - text = text.replace("\n", " ") - return text - except (TypeError, AttributeError): - _raise_serialization_error(text) - -def _escape_attrib_html(text): - # escape attribute value - try: - if "&" in text: - text = text.replace("&", "&") - if "<" in text: - text = text.replace("<", "<") - if ">" in text: - text = text.replace(">", ">") - if "\"" in text: - text = text.replace("\"", """) - return text - except (TypeError, AttributeError): - _raise_serialization_error(text) - - -def _serialize_html(write, elem, qnames, namespaces, format): - tag = elem.tag - text = elem.text - if tag is Comment: - write("" % _escape_cdata(text)) - elif tag is ProcessingInstruction: - write("" % _escape_cdata(text)) - else: - tag = qnames[tag] - if tag is None: - if text: - write(_escape_cdata(text)) - for e in elem: - _serialize_html(write, e, qnames, None, format) - else: - write("<" + tag) - items = elem.items() - if items or namespaces: - items.sort() # lexical order - for k, v in items: - if isinstance(k, QName): - k = k.text - if isinstance(v, QName): - v = qnames[v.text] - else: - v = _escape_attrib_html(v) - if qnames[k] == v and format == 'html': - # handle boolean attributes - write(" %s" % v) - else: - write(" %s=\"%s\"" % (qnames[k], v)) - if namespaces: - items = namespaces.items() - items.sort(key=lambda x: x[1]) # sort on prefix - for v, k in items: - if k: - k = ":" + k - write(" xmlns%s=\"%s\"" % (k, _escape_attrib(v))) - if format == "xhtml" and tag in HTML_EMPTY: - write(" />") - else: - write(">") - tag = tag.lower() - if text: - if tag == "script" or tag == "style": - write(text) - else: - write(_escape_cdata(text)) - for e in elem: - _serialize_html(write, e, qnames, None, format) - if tag not in HTML_EMPTY: - write("") - if elem.tail: - write(_escape_cdata(elem.tail)) - -def _write_html(root, - encoding=None, - default_namespace=None, - format="html"): - assert root is not None - data = [] - write = data.append - qnames, namespaces = _namespaces(root, default_namespace) - _serialize_html(write, root, qnames, namespaces, format) - if encoding is None: - return "".join(data) - else: - return _encode("".join(data)) - - -# -------------------------------------------------------------------- -# serialization support - -def _namespaces(elem, default_namespace=None): - # identify namespaces used in this tree - - # maps qnames to *encoded* prefix:local names - qnames = {None: None} - - # maps uri:s to prefixes - namespaces = {} - if default_namespace: - namespaces[default_namespace] = "" - - def add_qname(qname): - # calculate serialized qname representation - try: - if qname[:1] == "{": - uri, tag = qname[1:].split("}", 1) - prefix = namespaces.get(uri) - if prefix is None: - prefix = _namespace_map.get(uri) - if prefix is None: - prefix = "ns%d" % len(namespaces) - if prefix != "xml": - namespaces[uri] = prefix - if prefix: - qnames[qname] = "%s:%s" % (prefix, tag) - else: - qnames[qname] = tag # default element - else: - if default_namespace: - raise ValueError( - "cannot use non-qualified names with " - "default_namespace option" - ) - qnames[qname] = qname - except TypeError: - _raise_serialization_error(qname) - - # populate qname and namespaces table - try: - iterate = elem.iter - except AttributeError: - iterate = elem.getiterator # cET compatibility - for elem in iterate(): - tag = elem.tag - if isinstance(tag, QName) and tag.text not in qnames: - add_qname(tag.text) - elif isinstance(tag, basestring): - if tag not in qnames: - add_qname(tag) - elif tag is not None and tag is not Comment and tag is not PI: - _raise_serialization_error(tag) - for key, value in elem.items(): - if isinstance(key, QName): - key = key.text - if key not in qnames: - add_qname(key) - if isinstance(value, QName) and value.text not in qnames: - add_qname(value.text) - text = elem.text - if isinstance(text, QName) and text.text not in qnames: - add_qname(text.text) - return qnames, namespaces - -def to_html_string(element): - return _write_html(ElementTree(element).getroot(), format="html") - -def to_xhtml_string(element): - return _write_html(ElementTree(element).getroot(), format="xhtml") diff -Nru python-markdown-2.1.0/markdown/serializers.py python-markdown-2.1.1/markdown/serializers.py --- python-markdown-2.1.0/markdown/serializers.py 1970-01-01 00:00:00.000000000 +0000 +++ python-markdown-2.1.1/markdown/serializers.py 2012-01-22 18:34:40.000000000 +0000 @@ -0,0 +1,275 @@ +# markdown/searializers.py +# +# Add x/html serialization to Elementree +# Taken from ElementTree 1.3 preview with slight modifications +# +# Copyright (c) 1999-2007 by Fredrik Lundh. All rights reserved. +# +# fredrik@pythonware.com +# http://www.pythonware.com +# +# -------------------------------------------------------------------- +# The ElementTree toolkit is +# +# Copyright (c) 1999-2007 by Fredrik Lundh +# +# By obtaining, using, and/or copying this software and/or its +# associated documentation, you agree that you have read, understood, +# and will comply with the following terms and conditions: +# +# Permission to use, copy, modify, and distribute this software and +# its associated documentation for any purpose and without fee is +# hereby granted, provided that the above copyright notice appears in +# all copies, and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name of +# Secret Labs AB or the author not be used in advertising or publicity +# pertaining to distribution of the software without specific, written +# prior permission. +# +# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- +# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR +# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY +# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# -------------------------------------------------------------------- + + +import util +ElementTree = util.etree.ElementTree +QName = util.etree.QName +if hasattr(util.etree, 'test_comment'): + Comment = util.etree.test_comment +else: + Comment = util.etree.Comment +PI = util.etree.PI +ProcessingInstruction = util.etree.ProcessingInstruction + +__all__ = ['to_html_string', 'to_xhtml_string'] + +HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr", + "img", "input", "isindex", "link", "meta" "param") + +try: + HTML_EMPTY = set(HTML_EMPTY) +except NameError: + pass + +_namespace_map = { + # "well-known" namespace prefixes + "http://www.w3.org/XML/1998/namespace": "xml", + "http://www.w3.org/1999/xhtml": "html", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", + "http://schemas.xmlsoap.org/wsdl/": "wsdl", + # xml schema + "http://www.w3.org/2001/XMLSchema": "xs", + "http://www.w3.org/2001/XMLSchema-instance": "xsi", + # dublic core + "http://purl.org/dc/elements/1.1/": "dc", +} + + +def _raise_serialization_error(text): + raise TypeError( + "cannot serialize %r (type %s)" % (text, type(text).__name__) + ) + +def _encode(text, encoding): + try: + return text.encode(encoding, "xmlcharrefreplace") + except (TypeError, AttributeError): + _raise_serialization_error(text) + +def _escape_cdata(text): + # escape character data + try: + # it's worth avoiding do-nothing calls for strings that are + # shorter than 500 character, or so. assume that's, by far, + # the most common case in most applications. + if "&" in text: + text = text.replace("&", "&") + if "<" in text: + text = text.replace("<", "<") + if ">" in text: + text = text.replace(">", ">") + return text + except (TypeError, AttributeError): + _raise_serialization_error(text) + + +def _escape_attrib(text): + # escape attribute value + try: + if "&" in text: + text = text.replace("&", "&") + if "<" in text: + text = text.replace("<", "<") + if ">" in text: + text = text.replace(">", ">") + if "\"" in text: + text = text.replace("\"", """) + if "\n" in text: + text = text.replace("\n", " ") + return text + except (TypeError, AttributeError): + _raise_serialization_error(text) + +def _escape_attrib_html(text): + # escape attribute value + try: + if "&" in text: + text = text.replace("&", "&") + if "<" in text: + text = text.replace("<", "<") + if ">" in text: + text = text.replace(">", ">") + if "\"" in text: + text = text.replace("\"", """) + return text + except (TypeError, AttributeError): + _raise_serialization_error(text) + + +def _serialize_html(write, elem, qnames, namespaces, format): + tag = elem.tag + text = elem.text + if tag is Comment: + write("" % _escape_cdata(text)) + elif tag is ProcessingInstruction: + write("" % _escape_cdata(text)) + else: + tag = qnames[tag] + if tag is None: + if text: + write(_escape_cdata(text)) + for e in elem: + _serialize_html(write, e, qnames, None, format) + else: + write("<" + tag) + items = elem.items() + if items or namespaces: + items.sort() # lexical order + for k, v in items: + if isinstance(k, QName): + k = k.text + if isinstance(v, QName): + v = qnames[v.text] + else: + v = _escape_attrib_html(v) + if qnames[k] == v and format == 'html': + # handle boolean attributes + write(" %s" % v) + else: + write(" %s=\"%s\"" % (qnames[k], v)) + if namespaces: + items = namespaces.items() + items.sort(key=lambda x: x[1]) # sort on prefix + for v, k in items: + if k: + k = ":" + k + write(" xmlns%s=\"%s\"" % (k, _escape_attrib(v))) + if format == "xhtml" and tag in HTML_EMPTY: + write(" />") + else: + write(">") + tag = tag.lower() + if text: + if tag == "script" or tag == "style": + write(text) + else: + write(_escape_cdata(text)) + for e in elem: + _serialize_html(write, e, qnames, None, format) + if tag not in HTML_EMPTY: + write("") + if elem.tail: + write(_escape_cdata(elem.tail)) + +def _write_html(root, + encoding=None, + default_namespace=None, + format="html"): + assert root is not None + data = [] + write = data.append + qnames, namespaces = _namespaces(root, default_namespace) + _serialize_html(write, root, qnames, namespaces, format) + if encoding is None: + return "".join(data) + else: + return _encode("".join(data)) + + +# -------------------------------------------------------------------- +# serialization support + +def _namespaces(elem, default_namespace=None): + # identify namespaces used in this tree + + # maps qnames to *encoded* prefix:local names + qnames = {None: None} + + # maps uri:s to prefixes + namespaces = {} + if default_namespace: + namespaces[default_namespace] = "" + + def add_qname(qname): + # calculate serialized qname representation + try: + if qname[:1] == "{": + uri, tag = qname[1:].split("}", 1) + prefix = namespaces.get(uri) + if prefix is None: + prefix = _namespace_map.get(uri) + if prefix is None: + prefix = "ns%d" % len(namespaces) + if prefix != "xml": + namespaces[uri] = prefix + if prefix: + qnames[qname] = "%s:%s" % (prefix, tag) + else: + qnames[qname] = tag # default element + else: + if default_namespace: + raise ValueError( + "cannot use non-qualified names with " + "default_namespace option" + ) + qnames[qname] = qname + except TypeError: + _raise_serialization_error(qname) + + # populate qname and namespaces table + try: + iterate = elem.iter + except AttributeError: + iterate = elem.getiterator # cET compatibility + for elem in iterate(): + tag = elem.tag + if isinstance(tag, QName) and tag.text not in qnames: + add_qname(tag.text) + elif isinstance(tag, basestring): + if tag not in qnames: + add_qname(tag) + elif tag is not None and tag is not Comment and tag is not PI: + _raise_serialization_error(tag) + for key, value in elem.items(): + if isinstance(key, QName): + key = key.text + if key not in qnames: + add_qname(key) + if isinstance(value, QName) and value.text not in qnames: + add_qname(value.text) + text = elem.text + if isinstance(text, QName) and text.text not in qnames: + add_qname(text.text) + return qnames, namespaces + +def to_html_string(element): + return _write_html(ElementTree(element).getroot(), format="html") + +def to_xhtml_string(element): + return _write_html(ElementTree(element).getroot(), format="xhtml") diff -Nru python-markdown-2.1.0/PKG-INFO python-markdown-2.1.1/PKG-INFO --- python-markdown-2.1.0/PKG-INFO 2011-11-24 20:14:46.000000000 +0000 +++ python-markdown-2.1.1/PKG-INFO 2012-01-22 18:57:46.000000000 +0000 @@ -1,12 +1,12 @@ Metadata-Version: 1.0 Name: Markdown -Version: 2.1.0 +Version: 2.1.1 Summary: Python implementation of Markdown. Home-page: http://www.freewisdom.org/projects/python-markdown Author: Waylan Limberg Author-email: waylan [at] gmail.com License: BSD License -Download-URL: http://pypi.python.org/packages/source/M/Markdown/Markdown-2.1.0.tar.gz +Download-URL: http://pypi.python.org/packages/source/M/Markdown/Markdown-2.1.1.tar.gz Description: UNKNOWN Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable diff -Nru python-markdown-2.1.0/setup.py python-markdown-2.1.1/setup.py --- python-markdown-2.1.0/setup.py 2011-11-24 20:04:34.000000000 +0000 +++ python-markdown-2.1.1/setup.py 2012-01-22 18:51:46.000000000 +0000 @@ -16,7 +16,7 @@ raise ImportError("build_py_2to3 is required to build in Python 3.x.") from distutils.command.build_py import build_py -version = '2.1.0' +version = '2.1.1' # The command line script name. Currently set to "markdown_py" so as not to # conflict with the perl implimentation (which uses "markdown"). We can't use diff -Nru python-markdown-2.1.0/tests/basic/inline-html-simple.html python-markdown-2.1.1/tests/basic/inline-html-simple.html --- python-markdown-2.1.0/tests/basic/inline-html-simple.html 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/basic/inline-html-simple.html 2012-01-22 18:34:40.000000000 +0000 @@ -55,4 +55,6 @@
-
\ No newline at end of file +
+ +

weird stuff>

\ No newline at end of file diff -Nru python-markdown-2.1.0/tests/basic/inline-html-simple.txt python-markdown-2.1.1/tests/basic/inline-html-simple.txt --- python-markdown-2.1.0/tests/basic/inline-html-simple.txt 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/basic/inline-html-simple.txt 2012-01-22 18:34:40.000000000 +0000 @@ -67,3 +67,4 @@
+ diff -Nru python-markdown-2.1.0/tests/extensions/fenced_code.html python-markdown-2.1.1/tests/extensions/fenced_code.html --- python-markdown-2.1.0/tests/extensions/fenced_code.html 1970-01-01 00:00:00.000000000 +0000 +++ python-markdown-2.1.1/tests/extensions/fenced_code.html 2012-01-19 02:41:46.000000000 +0000 @@ -0,0 +1,32 @@ +

index 0000000..6e956a9

+
--- /dev/null
++++ b/test/data/stripped_text/mike-30-lili
+@@ -0,0 +1,27 @@
++Summary:
++ drift_mod.py |    1 +
++ 1 files changed, 1 insertions(+), 0 deletions(-)
++
++commit da4bfb04debdd994683740878d09988b2641513d
++Author: Mike Dirolf <mike@dirolf.com>
++Date:   Tue Jan 17 13:42:28 2012 -0500
++
++```
++minor: just wanted to push something.
++```
++
++diff --git a/drift_mod.py b/drift_mod.py
++index 34dfba6..8a88a69 100644
++
++```
++--- a/drift_mod.py
+++++ b/drift_mod.py
++@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^('
++                                        '|\+ .*'
++                                        '|- .*'
++                                        ')$')
+++
++ def wrap_context_diffs(message_text):
++     return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN,
++                       CONTEXT_DIFF_LINE_PATTERN,
++```
+
\ No newline at end of file diff -Nru python-markdown-2.1.0/tests/extensions/fenced_code.txt python-markdown-2.1.1/tests/extensions/fenced_code.txt --- python-markdown-2.1.0/tests/extensions/fenced_code.txt 1970-01-01 00:00:00.000000000 +0000 +++ python-markdown-2.1.1/tests/extensions/fenced_code.txt 2012-01-19 02:41:46.000000000 +0000 @@ -0,0 +1,34 @@ +index 0000000..6e956a9 + +``` +--- /dev/null ++++ b/test/data/stripped_text/mike-30-lili +@@ -0,0 +1,27 @@ ++Summary: ++ drift_mod.py | 1 + ++ 1 files changed, 1 insertions(+), 0 deletions(-) ++ ++commit da4bfb04debdd994683740878d09988b2641513d ++Author: Mike Dirolf ++Date: Tue Jan 17 13:42:28 2012 -0500 ++ ++``` ++minor: just wanted to push something. ++``` ++ ++diff --git a/drift_mod.py b/drift_mod.py ++index 34dfba6..8a88a69 100644 ++ ++``` ++--- a/drift_mod.py +++++ b/drift_mod.py ++@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^(' ++ '|\+ .*' ++ '|- .*' ++ ')$') +++ ++ def wrap_context_diffs(message_text): ++ return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN, ++ CONTEXT_DIFF_LINE_PATTERN, ++``` +``` diff -Nru python-markdown-2.1.0/tests/extensions/github_flavored.html python-markdown-2.1.1/tests/extensions/github_flavored.html --- python-markdown-2.1.0/tests/extensions/github_flavored.html 1970-01-01 00:00:00.000000000 +0000 +++ python-markdown-2.1.1/tests/extensions/github_flavored.html 2012-01-22 18:34:40.000000000 +0000 @@ -0,0 +1,32 @@ +

index 0000000..6e956a9

+
--- /dev/null
++++ b/test/data/stripped_text/mike-30-lili
+@@ -0,0 +1,27 @@
++Summary:
++ drift_mod.py |    1 +
++ 1 files changed, 1 insertions(+), 0 deletions(-)
++
++commit da4bfb04debdd994683740878d09988b2641513d
++Author: Mike Dirolf <mike@dirolf.com>
++Date:   Tue Jan 17 13:42:28 2012 -0500
++
++```
++minor: just wanted to push something.
++```
++
++diff --git a/drift_mod.py b/drift_mod.py
++index 34dfba6..8a88a69 100644
++
++```
++--- a/drift_mod.py
+++++ b/drift_mod.py
++@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^('
++                                        '|\+ .*'
++                                        '|- .*'
++                                        ')$')
+++
++ def wrap_context_diffs(message_text):
++     return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN,
++                       CONTEXT_DIFF_LINE_PATTERN,
++```
+
\ No newline at end of file diff -Nru python-markdown-2.1.0/tests/extensions/github_flavored.txt python-markdown-2.1.1/tests/extensions/github_flavored.txt --- python-markdown-2.1.0/tests/extensions/github_flavored.txt 1970-01-01 00:00:00.000000000 +0000 +++ python-markdown-2.1.1/tests/extensions/github_flavored.txt 2012-01-19 02:41:46.000000000 +0000 @@ -0,0 +1,34 @@ +index 0000000..6e956a9 + +```diff +--- /dev/null ++++ b/test/data/stripped_text/mike-30-lili +@@ -0,0 +1,27 @@ ++Summary: ++ drift_mod.py | 1 + ++ 1 files changed, 1 insertions(+), 0 deletions(-) ++ ++commit da4bfb04debdd994683740878d09988b2641513d ++Author: Mike Dirolf ++Date: Tue Jan 17 13:42:28 2012 -0500 ++ ++``` ++minor: just wanted to push something. ++``` ++ ++diff --git a/drift_mod.py b/drift_mod.py ++index 34dfba6..8a88a69 100644 ++ ++``` ++--- a/drift_mod.py +++++ b/drift_mod.py ++@@ -281,6 +281,7 @@ CONTEXT_DIFF_LINE_PATTERN = re.compile(r'^(' ++ '|\+ .*' ++ '|- .*' ++ ')$') +++ ++ def wrap_context_diffs(message_text): ++ return _wrap_diff(CONTEXT_DIFF_HEADER_PATTERN, ++ CONTEXT_DIFF_LINE_PATTERN, ++``` +``` diff -Nru python-markdown-2.1.0/tests/extensions/test.cfg python-markdown-2.1.1/tests/extensions/test.cfg --- python-markdown-2.1.0/tests/extensions/test.cfg 2011-07-22 21:26:54.000000000 +0000 +++ python-markdown-2.1.1/tests/extensions/test.cfg 2012-01-22 18:34:40.000000000 +0000 @@ -4,7 +4,7 @@ [codehilite] extensions=codehilite # This passes or not based on version of pygments. -skip=1 +skip=1 [toc] extensions=toc @@ -20,3 +20,9 @@ [wikilinks] extensions=wikilinks + +[fenced_code] +extensions=fenced_code + +[github_flavored] +extensions=fenced_code diff -Nru python-markdown-2.1.0/tests/misc/comments.html python-markdown-2.1.1/tests/misc/comments.html --- python-markdown-2.1.0/tests/misc/comments.html 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/misc/comments.html 2012-01-19 02:19:48.000000000 +0000 @@ -2,4 +2,8 @@

X>0

-
as if
\ No newline at end of file +
as if
+ + + +

no blank line

\ No newline at end of file diff -Nru python-markdown-2.1.0/tests/misc/comments.txt python-markdown-2.1.1/tests/misc/comments.txt --- python-markdown-2.1.0/tests/misc/comments.txt 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/misc/comments.txt 2012-01-19 02:19:48.000000000 +0000 @@ -5,3 +5,6 @@
as if
+ + +__no blank line__ diff -Nru python-markdown-2.1.0/tests/misc/mismatched-tags.html python-markdown-2.1.1/tests/misc/mismatched-tags.html --- python-markdown-2.1.0/tests/misc/mismatched-tags.html 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/misc/mismatched-tags.html 2012-01-19 02:19:48.000000000 +0000 @@ -6,6 +6,9 @@

And this output

Compatible with PHP Markdown Extra 1.2.2 and Markdown.pl1.0.2b8:

-

text


+ +

text

+ +


Should be in p

\ No newline at end of file diff -Nru python-markdown-2.1.0/tests/misc/multiline-comments.html python-markdown-2.1.1/tests/misc/multiline-comments.html --- python-markdown-2.1.0/tests/misc/multiline-comments.html 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/misc/multiline-comments.html 2012-01-19 02:19:48.000000000 +0000 @@ -2,7 +2,7 @@ foo ---> +-->

diff -Nru python-markdown-2.1.0/tests/misc/multi-line-tags.html python-markdown-2.1.1/tests/misc/multi-line-tags.html --- python-markdown-2.1.0/tests/misc/multi-line-tags.html 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/misc/multi-line-tags.html 2012-01-19 02:19:48.000000000 +0000 @@ -2,4 +2,12 @@ asdf asdfasd - \ No newline at end of file + + +

+ +foo bar + +
+ +

No blank line.

\ No newline at end of file diff -Nru python-markdown-2.1.0/tests/misc/multi-line-tags.txt python-markdown-2.1.1/tests/misc/multi-line-tags.txt --- python-markdown-2.1.0/tests/misc/multi-line-tags.txt 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/misc/multi-line-tags.txt 2012-01-19 02:19:48.000000000 +0000 @@ -4,3 +4,10 @@ asdf asdfasd + +
+ +foo bar + +
+No blank line. diff -Nru python-markdown-2.1.0/tests/safe_mode/html_then_blockquote.html python-markdown-2.1.1/tests/safe_mode/html_then_blockquote.html --- python-markdown-2.1.0/tests/safe_mode/html_then_blockquote.html 1970-01-01 00:00:00.000000000 +0000 +++ python-markdown-2.1.1/tests/safe_mode/html_then_blockquote.html 2012-01-22 18:34:40.000000000 +0000 @@ -0,0 +1,6 @@ +

to:

+

<td /><td style="text-align: center; white-space: nowrap;"><br />

+
+

3) You don't need to alter all localization files. + Adding the new labels to the en_US files will do it.

+
\ No newline at end of file diff -Nru python-markdown-2.1.0/tests/safe_mode/html_then_blockquote.txt python-markdown-2.1.1/tests/safe_mode/html_then_blockquote.txt --- python-markdown-2.1.0/tests/safe_mode/html_then_blockquote.txt 1970-01-01 00:00:00.000000000 +0000 +++ python-markdown-2.1.1/tests/safe_mode/html_then_blockquote.txt 2012-01-19 02:41:46.000000000 +0000 @@ -0,0 +1,6 @@ +to: + +
+ +> 3) You don't need to alter all localization files. +> Adding the new labels to the en_US files will do it. diff -Nru python-markdown-2.1.0/tests/safe_mode/inline-html-simple.html python-markdown-2.1.1/tests/safe_mode/inline-html-simple.html --- python-markdown-2.1.0/tests/safe_mode/inline-html-simple.html 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/safe_mode/inline-html-simple.html 2012-01-22 18:34:40.000000000 +0000 @@ -29,7 +29,8 @@
<!-- Comment -->
 

Just plain comment, with trailing spaces on the line:

-

<!-- foo -->

+

<!-- foo -->
+

Code:

<hr />
 
@@ -37,9 +38,12 @@

<hr>

<hr/>

<hr />

-

<hr>

-

<hr/>

-

<hr />

-

<hr class="foo" id="bar" />

-

<hr class="foo" id="bar"/>

-

<hr class="foo" id="bar" >

\ No newline at end of file +

<hr>
+

+

<hr/>
+

+

<hr />

+

<hr class="foo" id="bar" />

+

<hr class="foo" id="bar"/>

+

<hr class="foo" id="bar" >

+

<some weird stuff>

\ No newline at end of file diff -Nru python-markdown-2.1.0/tests/safe_mode/inline-html-simple.txt python-markdown-2.1.1/tests/safe_mode/inline-html-simple.txt --- python-markdown-2.1.0/tests/safe_mode/inline-html-simple.txt 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/safe_mode/inline-html-simple.txt 2012-01-22 18:34:40.000000000 +0000 @@ -67,3 +67,4 @@
+ diff -Nru python-markdown-2.1.0/tests/safe_mode/remove.html python-markdown-2.1.1/tests/safe_mode/remove.html --- python-markdown-2.1.0/tests/safe_mode/remove.html 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/safe_mode/remove.html 2012-01-22 18:34:40.000000000 +0000 @@ -31,4 +31,5 @@

+

\ No newline at end of file diff -Nru python-markdown-2.1.0/tests/safe_mode/remove.txt python-markdown-2.1.1/tests/safe_mode/remove.txt --- python-markdown-2.1.0/tests/safe_mode/remove.txt 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/safe_mode/remove.txt 2012-01-22 18:34:40.000000000 +0000 @@ -67,3 +67,4 @@
+ diff -Nru python-markdown-2.1.0/tests/safe_mode/replace.html python-markdown-2.1.1/tests/safe_mode/replace.html --- python-markdown-2.1.0/tests/safe_mode/replace.html 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/safe_mode/replace.html 2012-01-22 18:34:40.000000000 +0000 @@ -31,4 +31,5 @@

[HTML_REMOVED]

[HTML_REMOVED]

[HTML_REMOVED]

+

[HTML_REMOVED]

[HTML_REMOVED]

\ No newline at end of file diff -Nru python-markdown-2.1.0/tests/safe_mode/replace.txt python-markdown-2.1.1/tests/safe_mode/replace.txt --- python-markdown-2.1.0/tests/safe_mode/replace.txt 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/safe_mode/replace.txt 2012-01-22 18:34:40.000000000 +0000 @@ -67,3 +67,4 @@
+ diff -Nru python-markdown-2.1.0/tests/safe_mode/script_tags.html python-markdown-2.1.1/tests/safe_mode/script_tags.html --- python-markdown-2.1.0/tests/safe_mode/script_tags.html 2011-04-29 02:02:44.000000000 +0000 +++ python-markdown-2.1.1/tests/safe_mode/script_tags.html 2012-01-22 18:34:40.000000000 +0000 @@ -1,28 +1,20 @@

This should be stripped/escaped in safe_mode.

<script> -alert("Hello world!") +alert("Hello world!") </script>

With blank lines.

-

<script> - -alert("Hello world!") - -</script>

+

<script>

+

alert("Hello world!")

+

</script>

Now with some weirdness

<script <!-- alert("Hello world!") </script <> `

Try another way.

<script <!-- -alert("Hello world!") -</script <> - -This time with blank lines. - -<script <!-- - -alert("Hello world!") - -</script <> - -

\ No newline at end of file +alert("Hello world!") +</script <>

+

This time with blank lines.

+

<script <!--

+

alert("Hello world!")

+

</script <>

\ No newline at end of file diff -Nru python-markdown-2.1.0/tests/test_apis.py python-markdown-2.1.1/tests/test_apis.py --- python-markdown-2.1.0/tests/test_apis.py 2011-07-29 01:53:22.000000000 +0000 +++ python-markdown-2.1.1/tests/test_apis.py 2012-01-22 18:34:40.000000000 +0000 @@ -46,7 +46,7 @@ root = markdown.util.etree.Element("div") text = 'foo' self.parser.parseChunk(root, text) - self.assertEqual(markdown.searializers.to_xhtml_string(root), + self.assertEqual(markdown.serializers.to_xhtml_string(root), "

foo

") def testParseDocument(self): @@ -55,7 +55,7 @@ tree = self.parser.parseDocument(lines) self.assertTrue(isinstance(tree, markdown.util.etree.ElementTree)) self.assertTrue(markdown.util.etree.iselement(tree.getroot())) - self.assertEqual(markdown.searializers.to_xhtml_string(tree.getroot()), + self.assertEqual(markdown.serializers.to_xhtml_string(tree.getroot()), "

foo

bar

baz\n
") @@ -303,14 +303,14 @@ def testCommentSerialization(self): """ Test that an ElementTree Comment serializes properly. """ - self.assertEqual(markdown.searializers.to_html_string(self.comment), + self.assertEqual(markdown.serializers.to_html_string(self.comment), '') def testCommentPrettify(self): """ Test that an ElementTree Comment is prettified properly. """ pretty = markdown.treeprocessors.PrettifyTreeprocessor() pretty.run(self.comment) - self.assertEqual(markdown.searializers.to_html_string(self.comment), + self.assertEqual(markdown.serializers.to_html_string(self.comment), '\n') @@ -327,7 +327,7 @@ p = markdown.util.etree.SubElement(tree, 'p') p.text = u'some *text*' new = self.inlineprocessor.run(tree) - self.assertEqual(markdown.searializers.to_html_string(new), + self.assertEqual(markdown.serializers.to_html_string(new), '

some text

') def testSimpleAtomicString(self): @@ -336,7 +336,7 @@ p = markdown.util.etree.SubElement(tree, 'p') p.text = markdown.util.AtomicString(u'some *text*') new = self.inlineprocessor.run(tree) - self.assertEqual(markdown.searializers.to_html_string(new), + self.assertEqual(markdown.serializers.to_html_string(new), '

some *text*

') def testNestedAtomicString(self): @@ -354,7 +354,7 @@ span2.tail = markdown.util.AtomicString(u' *test*') span1.tail = markdown.util.AtomicString(u' *with*') new = self.inlineprocessor.run(tree) - self.assertEqual(markdown.searializers.to_html_string(new), + self.assertEqual(markdown.serializers.to_html_string(new), '

*some* *more* *text* *here* ' '*to* *test* *with*

')