Skip to content

Commit 19f459a

Browse files
author
Waylan Limberg
committed
Updated version to 2.2.0.alpha.
1 parent 141bcce commit 19f459a

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

markdown/__init__.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
License: BSD (see LICENSE for details).
3131
"""
3232

33-
version = "2.1.1"
34-
version_info = (2,1,1, "final")
33+
version = "2.2.0"
34+
version_info = (2,2,0, "alpha")
3535

3636
import re
3737
import codecs
@@ -55,15 +55,15 @@ class Markdown:
5555
"""Convert Markdown to HTML."""
5656

5757
doc_tag = "div" # Element used to wrap document - later removed
58-
58+
5959
option_defaults = {
6060
'html_replacement_text' : '[HTML_REMOVED]',
6161
'tab_length' : 4,
6262
'enable_attributes' : True,
6363
'smart_emphasis' : True,
6464
'lazy_ol' : True,
6565
}
66-
66+
6767
output_formats = {
6868
'html' : to_html_string,
6969
'html4' : to_html_string,
@@ -73,9 +73,9 @@ class Markdown:
7373
'xhtml5': to_xhtml_string,
7474
}
7575

76-
ESCAPED_CHARS = ['\\', '`', '*', '_', '{', '}', '[', ']',
76+
ESCAPED_CHARS = ['\\', '`', '*', '_', '{', '}', '[', ']',
7777
'(', ')', '>', '#', '+', '-', '.', '!']
78-
78+
7979
def __init__(self, *args, **kwargs):
8080
"""
8181
Creates a new Markdown instance.
@@ -119,7 +119,7 @@ def __init__(self, *args, **kwargs):
119119

120120
# Loop through kwargs and assign defaults
121121
for option, default in self.option_defaults.items():
122-
setattr(self, option, kwargs.get(option, default))
122+
setattr(self, option, kwargs.get(option, default))
123123

124124
self.safeMode = kwargs.get('safe_mode', False)
125125
if self.safeMode and not kwargs.has_key('enable_attributes'):
@@ -142,7 +142,7 @@ def __init__(self, *args, **kwargs):
142142
def build_parser(self):
143143
""" Build the parser from the various parts. """
144144
self.preprocessors = build_preprocessors(self)
145-
self.parser = build_block_parser(self)
145+
self.parser = build_block_parser(self)
146146
self.inlinePatterns = build_inlinepatterns(self)
147147
self.treeprocessors = build_treeprocessors(self)
148148
self.postprocessors = build_postprocessors(self)
@@ -213,7 +213,7 @@ def build_extension(self, ext_name, configs = []):
213213
except AttributeError, e:
214214
logger.warn("Failed to initiate extension '%s': %s" % (ext_name, e))
215215
return None
216-
216+
217217
def registerExtension(self, extension):
218218
""" This gets called by the extension """
219219
self.registeredExtensions.append(extension)
@@ -254,10 +254,10 @@ def convert(self, source):
254254
1. A bunch of "preprocessors" munge the input text.
255255
2. BlockParser() parses the high-level structural elements of the
256256
pre-processed text into an ElementTree.
257-
3. A bunch of "treeprocessors" are run against the ElementTree. One
258-
such treeprocessor runs InlinePatterns against the ElementTree,
257+
3. A bunch of "treeprocessors" are run against the ElementTree. One
258+
such treeprocessor runs InlinePatterns against the ElementTree,
259259
detecting inline markup.
260-
4. Some post-processors are run against the text after the ElementTree
260+
4. Some post-processors are run against the text after the ElementTree
261261
has been serialized into text.
262262
5. The output is written to a string.
263263
@@ -266,7 +266,7 @@ def convert(self, source):
266266
# Fixup the source text
267267
if not source.strip():
268268
return u"" # a blank unicode string
269-
269+
270270
try:
271271
source = unicode(source)
272272
except UnicodeDecodeError, e:
@@ -358,8 +358,8 @@ def convertFile(self, input=None, output=None, encoding=None):
358358
# Write to file or stdout
359359
if output:
360360
if isinstance(output, str):
361-
output_file = codecs.open(output, "w",
362-
encoding=encoding,
361+
output_file = codecs.open(output, "w",
362+
encoding=encoding,
363363
errors="xmlcharrefreplace")
364364
output_file.write(html)
365365
output_file.close()
@@ -403,17 +403,17 @@ def markdown(text, *args, **kwargs):
403403

404404
def markdownFromFile(*args, **kwargs):
405405
"""Read markdown code from a file and write it to a file or a stream.
406-
406+
407407
This is a shortcut function which initializes an instance of Markdown,
408408
and calls the convertFile method rather than convert.
409-
409+
410410
Keyword arguments:
411-
411+
412412
* input: a file name or readable object.
413413
* output: a file name or writable object.
414414
* encoding: Encoding of input and output.
415415
* Any arguments accepted by the Markdown class.
416-
416+
417417
"""
418418
# For backward compatibility loop through positional args
419419
pos = ['input', 'output', 'extensions', 'encoding']
@@ -426,7 +426,7 @@ def markdownFromFile(*args, **kwargs):
426426
break
427427

428428
md = Markdown(**kwargs)
429-
md.convertFile(kwargs.get('input', None),
429+
md.convertFile(kwargs.get('input', None),
430430
kwargs.get('output', None),
431431
kwargs.get('encoding', None))
432432

setup.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
raise ImportError("build_py_2to3 is required to build in Python 3.x.")
1717
from distutils.command.build_py import build_py
1818

19-
version = '2.1.1'
19+
version = '2.2.0'
2020

21-
# The command line script name. Currently set to "markdown_py" so as not to
21+
# The command line script name. Currently set to "markdown_py" so as not to
2222
# conflict with the perl implimentation (which uses "markdown"). We can't use
2323
# "markdown.py" as the default config on some systems will cause the script to
24-
# try to import itself rather than the library which will raise an error.
24+
# try to import itself rather than the library which will raise an error.
2525
SCRIPT_NAME = 'markdown_py'
2626

2727
class md_install_scripts(install_scripts):
@@ -63,8 +63,8 @@ def initialize_options(self):
6363
self.sitemap = ''
6464

6565
def finalize_options(self):
66-
self.set_undefined_options('build',
67-
('build_base', 'build_base'),
66+
self.set_undefined_options('build',
67+
('build_base', 'build_base'),
6868
('force', 'force'))
6969
self.docs = self._get_docs()
7070

@@ -117,7 +117,7 @@ def _get_context(self, src, path):
117117
return c
118118

119119
def run(self):
120-
# Before importing markdown, tweak sys.path to import from the
120+
# Before importing markdown, tweak sys.path to import from the
121121
# build directory (2to3 might have run on the library).
122122
bld_cmd = self.get_finalized_command("build")
123123
sys.path.insert(0, bld_cmd.build_lib)
@@ -176,7 +176,7 @@ def has_docs(self):
176176
license = 'BSD License',
177177
packages = ['markdown', 'markdown.extensions'],
178178
scripts = ['bin/%s' % SCRIPT_NAME],
179-
cmdclass = {'install_scripts': md_install_scripts,
179+
cmdclass = {'install_scripts': md_install_scripts,
180180
'build_py': build_py,
181181
'build_docs': build_docs,
182182
'build': md_build},
@@ -200,7 +200,7 @@ def has_docs(self):
200200
'Topic :: Text Processing :: Filters',
201201
'Topic :: Text Processing :: Markup :: HTML',
202202
],
203-
)
203+
)
204204

205205
if sys.version[:3] < '2.5':
206206
data['install_requires'] = ['elementtree']

0 commit comments

Comments
 (0)