Skip to content

Commit 6718e77

Browse files
committed
merge release/2.3.0 branch.
2 parents 13948a1 + 9c5b71a commit 6718e77

40 files changed

+2301
-1861
lines changed

.coveragerc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[run]
2+
branch = True
3+
4+
[report]
5+
show_missing = True
6+
omit =
7+
textile/tests/*

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
*~
55
*.pyo
66
*.egg-info
7+
.cache/
78
.coverage
9+
.eggs/
810
.noseids*
911
docs/build
1012
docs/coverage
1113
build
1214
bin
1315
dist
1416
eggs
17+
htmlcov
1518
parts
1619
develop-eggs
1720
.DS_Store

.travis.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
language: python
2+
env:
3+
- REQUIREMENTS=true
4+
- REQUIREMENTS=false
25
python:
36
- "2.6"
47
- "2.7"
58
- "3.2"
69
- "3.3"
710
- "3.4"
11+
- "3.5"
812
- "pypy"
913
# command to install dependencies
1014
install:
11-
- pip install -r requirements.txt
12-
- python setup.py -q install
13-
- if [[ ! $TRAVIS_PYTHON_VERSION == pypy ]] ; then pip install regex; fi
15+
- if [[ $REQUIREMENTS == true ]] ; then pip install -r requirements.txt ; fi
16+
- if [[ $TRAVIS_PYTHON_VERSION == '3.2' ]] ; then pip install coverage==3.7.1; fi
17+
- pip install coveralls pytest pytest-cov coverage codecov
18+
- pip install -e .
19+
- if [[ ! $TRAVIS_PYTHON_VERSION == 'pypy' ]] ; then pip install regex; fi
1420
# command to run tests
15-
script: nosetests
21+
script: py.test
22+
sudo: false
23+
after_success:
24+
- coveralls
25+
- codecov

CHANGELOG.textile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
11
h1. Textile Changelog
22

3-
h1. Version 2.2.1
3+
h2. Version 2.3.0
4+
5+
* Bugfixes:
6+
** Support data URIs in img tags
7+
** Fix autolink urls with image references ("#17":https://github.com/textile/python-textile/issues/17)
8+
** Fix textile links containing parentheses ("#20":https://github.com/textile/python-textile/issues/20)
9+
** Fix double-encoding of code blocks ("#21":https://github.com/textile/python-textile/issues/21)
10+
** Fix handling of scheme in self-linked URLs ("#16":https://github.com/textile/python-textile/issues/16)
11+
** Fix Markup not parsed if followed by certain characters ("#22":Markup not parsed if followed by certain characters)
12+
* Convert testing over to "py.test":http://pytest.org/, improving unicode testing
13+
* Update functionality for tables, notelists, and footnotes. This involved a major reworking of parts of the code, but it should now match php-textile and txstyle.org precisely. Please file an issue for any bugs you come across.
14+
15+
h2. Version 2.2.2
16+
17+
* bugfix: "regex":https://pypi.python.org/pypi/regex is now an optional dependency
18+
19+
h2. Version 2.2.1
420

521
* drop textilefactory support for html.
622
* Various development-related bugfixes.
723
* Added this changelog.
824

9-
h1. Version 2.2.0
25+
h2. Version 2.2.0
1026

1127
* Started refactoring the code to be less repetitive. @textile.Textile().parse()@ is a little more friendly than @textile.Textile().textile()@ There may be more work to be done on this front to make the flow a little smoother.
1228
* We now support versions 2.6 - 3.4 (including 3.2) using the same codebase. Many thanks to Radek Czajka for this.
1329
* Drop support for html4. We now only output xhtml or html5.
1430
* Various development-related bugfixes.
1531

16-
h1. Version 2.1.8
32+
h2. Version 2.1.8
1733

1834
* Add support for html5 output.
1935
* Lots of new functionality added bringing us in line with the official Textile 2.4

README.textile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
!https://travis-ci.org/textile/python-textile.svg?branch=develop!:https://travis-ci.org/textile/python-textile
1+
!https://travis-ci.org/textile/python-textile.svg?branch=develop!:https://travis-ci.org/textile/python-textile !https://coveralls.io/repos/github/textile/python-textile/badge.svg?branch=develop!:https://coveralls.io/github/textile/python-textile?branch=master !https://codecov.io/github/textile/python-textile/coverage.svg?branch=develop!:https://codecov.io/github/textile/python-textile?branch=develop
22

33
h1. python-textile
44

5-
python-textile is a Python port of Textile, Dean Allen's humane web text generator.
5+
python-textile is a Python port of "Textile":http://txstyle.org/, Dean Allen's humane web text generator.
66

77
h2. Installation
88

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).
9+
@pip install textile@
10+
11+
Optional dependencies include:
12+
* "PIL/Pillow":http://python-pillow.github.io/ (for checking images size)
13+
* "regex":https://pypi.python.org/pypi/regex (for faster unicode-aware string matching).
1214

1315
h2. Usage
1416

pytest.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[pytest]
2+
testpaths = tests
3+
addopts = --cov=textile --cov-report=html --cov-append --cov-report=term-missing

requirements.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
nose==1.3.4
2-
coverage==3.7.1
31
html5lib==0.999
4-
Pillow==2.6.0
2+
Pillow==3.0.0

setup.cfg

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
[nosetests]
2-
detailed-errors=1
3-
with-coverage=1
4-
cover-package=textile
5-
cover-erase=1
6-
with-doctest=1
7-
with-id = 1
1+
[aliases]
2+
test=pytest
83
[bdist_wheel]
94
universal=1

setup.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
import os
33
import sys
44

5-
install_requires = []
6-
7-
8-
if 'develop' in sys.argv:
9-
install_requires.extend([
10-
'tox',
11-
])
12-
135
def get_version():
146
basedir = os.path.dirname(__file__)
157
with open(os.path.join(basedir, 'textile/version.py')) as f:
@@ -32,14 +24,24 @@ def get_version():
3224
'Operating System :: OS Independent',
3325
'Programming Language :: Python',
3426
'Topic :: Software Development :: Libraries :: Python Modules',
27+
'Programming Language :: Python',
28+
'Programming Language :: Python :: 2',
29+
'Programming Language :: Python :: 2.6',
30+
'Programming Language :: Python :: 2.7',
31+
'Programming Language :: Python :: 3',
32+
'Programming Language :: Python :: 3.2',
33+
'Programming Language :: Python :: 3.3',
34+
'Programming Language :: Python :: 3.4',
35+
'Programming Language :: Python :: 3.5',
3536
],
36-
keywords='textile,text',
37-
install_requires=install_requires,
37+
keywords='textile,text,html markup',
38+
install_requires=['six',],
3839
extras_require={
3940
':python_version=="2.6"': ['ordereddict>=1.1'],
41+
'develop': ['regex', 'pytest', 'pytest-cov'],
4042
},
41-
test_suite='nose.collector',
42-
tests_require=['nose'],
43+
setup_requires=['pytest-runner'],
44+
tests_require=['pytest', 'pytest-cov'],
4345
include_package_data=True,
4446
zip_safe=False,
4547
)

tests/test_attributes.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from textile.utils import parse_attributes
2+
import re
3+
4+
def test_parse_attributes():
5+
assert parse_attributes('\\1', element='td') == {'colspan': '1'}
6+
assert parse_attributes('/1', element='td') == {'rowspan': '1'}
7+
assert parse_attributes('^', element='td') == {'style': 'vertical-align:top;'}
8+
assert parse_attributes('{color: blue}') == {'style': 'color: blue;'}
9+
assert parse_attributes('[en]') == {'lang': 'en'}
10+
assert parse_attributes('(cssclass)') == {'class': 'cssclass'}
11+
assert parse_attributes('(') == {'style': 'padding-left:1em;'}
12+
assert parse_attributes(')') == {'style': 'padding-right:1em;'}
13+
assert parse_attributes('<') == {'style': 'text-align:left;'}
14+
assert parse_attributes('(c#i)') == {'class': 'c', 'id': 'i'}
15+
assert parse_attributes('\\2 100', element='col') == {'span': '2', 'width': '100'}

0 commit comments

Comments
 (0)