Skip to content

Commit 12d3581

Browse files
committed
merge changes from master.
1 parent 597ed8d commit 12d3581

5 files changed

Lines changed: 17 additions & 11 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ install:
1212
- python setup.py -q install
1313
- if [[ ! $TRAVIS_PYTHON_VERSION == pypy ]] ; then pip install regex; fi
1414
# command to run tests
15-
script: nosetests
15+
script: nosetests

README.textile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ python-textile is a Python port of Textile, Dean Allen's humane web text generat
66

77
h2. Installation
88

9-
Install the 'textile' folder on your python path, or @pip install textile@
9+
Install the 'textile' folder on your python path, or @pip install textile@.
10+
Optional dependencies include PIL/Pillow (for checking images size)
11+
and regex (for faster unicode-aware string matching).
1012

1113
h2. Usage
1214

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44

55
install_requires = []
66

7-
try:
8-
from collections import OrderedDict
9-
except ImportError:
10-
install_requires.extend(['ordereddict>=1.1'])
117

128
if 'develop' in sys.argv:
139
install_requires.extend([
@@ -39,6 +35,9 @@ def get_version():
3935
],
4036
keywords='textile,text',
4137
install_requires=install_requires,
38+
extras_require={
39+
':python_version=="2.6"': ['ordereddict>=1.1'],
40+
},
4241
test_suite='nose.collector',
4342
tests_require=['nose'],
4443
include_package_data=True,

textile/core.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,9 @@ def __init__(self, restricted=False, lite=False, noimage=False,
148148
self.max_span_depth = 5
149149

150150
# We'll be searching for characters that need to be HTML-encoded to
151-
# produce properly valid html.
152-
# These are the defaults that work in most cases. Below, we'll copy
153-
# this and modify the necessary pieces to make it work for characters
154-
# at the beginning of the string.
151+
# produce properly valid html. These are the defaults that work in
152+
# most cases. Below, we'll copy this and modify the necessary pieces
153+
# to make it work for characters at the beginning of the string.
155154
self.glyph_search = [
156155
# apostrophe's
157156
re.compile(r"(^|\w)'(\w)", re.U),
@@ -192,7 +191,7 @@ def __init__(self, restricted=False, lite=False, noimage=False,
192191
# plus/minus
193192
re.compile(r'[([]\+\/-[])]', re.I | re.U),
194193
# 3+ uppercase acronym
195-
re.compile(r'\b([%s%s0-9]{2,})\b(?:[(]([^)]*)[)])' % (upper_re_s, upper_re_s)),
194+
re.compile(r'\b([%s][%s0-9]{2,})\b(?:[(]([^)]*)[)])' % (upper_re_s, upper_re_s)),
196195
# 3+ uppercase
197196
re.compile(r"""(?:(?<=^)|(?<=\s)|(?<=[>\(;-]))([%s]{3,})(\w*)(?=\s|%s|$)(?=[^">]*?(<|$))""" %
198197
(upper_re_s, self.pnct_re_s)),

tox.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ deps = nose
88
regex
99
Pillow
1010
commands = nosetests --id-file=.noseids.{envname}
11+
12+
[testenv:pypy]
13+
deps = nose
14+
coverage
15+
html5lib
16+
Pillow

0 commit comments

Comments
 (0)