Skip to content

Commit

Permalink
merge changes from master.
Browse files Browse the repository at this point in the history
  • Loading branch information
ikirudennis committed Jan 30, 2015
1 parent 597ed8d commit 12d3581
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -12,4 +12,4 @@ install:
- python setup.py -q install
- if [[ ! $TRAVIS_PYTHON_VERSION == pypy ]] ; then pip install regex; fi
# command to run tests
script: nosetests
script: nosetests
4 changes: 3 additions & 1 deletion README.textile
Expand Up @@ -6,7 +6,9 @@ python-textile is a Python port of Textile, Dean Allen's humane web text generat

h2. Installation

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

h2. Usage

Expand Down
7 changes: 3 additions & 4 deletions setup.py
Expand Up @@ -4,10 +4,6 @@

install_requires = []

try:
from collections import OrderedDict
except ImportError:
install_requires.extend(['ordereddict>=1.1'])

if 'develop' in sys.argv:
install_requires.extend([
Expand Down Expand Up @@ -39,6 +35,9 @@ def get_version():
],
keywords='textile,text',
install_requires=install_requires,
extras_require={
':python_version=="2.6"': ['ordereddict>=1.1'],
},
test_suite='nose.collector',
tests_require=['nose'],
include_package_data=True,
Expand Down
9 changes: 4 additions & 5 deletions textile/core.py
Expand Up @@ -148,10 +148,9 @@ def __init__(self, restricted=False, lite=False, noimage=False,
self.max_span_depth = 5

# We'll be searching for characters that need to be HTML-encoded to
# produce properly valid html.
# These are the defaults that work in most cases. Below, we'll copy
# this and modify the necessary pieces to make it work for characters
# at the beginning of the string.
# produce properly valid html. These are the defaults that work in
# most cases. Below, we'll copy this and modify the necessary pieces
# to make it work for characters at the beginning of the string.
self.glyph_search = [
# apostrophe's
re.compile(r"(^|\w)'(\w)", re.U),
Expand Down Expand Up @@ -192,7 +191,7 @@ def __init__(self, restricted=False, lite=False, noimage=False,
# plus/minus
re.compile(r'[([]\+\/-[])]', re.I | re.U),
# 3+ uppercase acronym
re.compile(r'\b([%s%s0-9]{2,})\b(?:[(]([^)]*)[)])' % (upper_re_s, upper_re_s)),
re.compile(r'\b([%s][%s0-9]{2,})\b(?:[(]([^)]*)[)])' % (upper_re_s, upper_re_s)),
# 3+ uppercase
re.compile(r"""(?:(?<=^)|(?<=\s)|(?<=[>\(;-]))([%s]{3,})(\w*)(?=\s|%s|$)(?=[^">]*?(<|$))""" %
(upper_re_s, self.pnct_re_s)),
Expand Down
6 changes: 6 additions & 0 deletions tox.ini
Expand Up @@ -8,3 +8,9 @@ deps = nose
regex
Pillow
commands = nosetests --id-file=.noseids.{envname}

[testenv:pypy]
deps = nose
coverage
html5lib
Pillow

0 comments on commit 12d3581

Please sign in to comment.