Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong output when "bc.." is the last block #81 #82

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cdfa949
Fix wrong output when "bc.." is the last block #81
kpot Aug 31, 2022
22d7e7f
Unite glyph regexes and replacements in one structure
kpot Sep 4, 2022
b84a477
Fix parsing of dimensions to pass php-textile`s test
kpot Sep 5, 2022
6286b80
Fix redundant spaces in quote-ending lines
kpot Sep 6, 2022
e05ef6d
Fix empty notelist leading to an empty <ol>
kpot Sep 6, 2022
175ac56
Fix HTML escaping and make it match php-textile`s
kpot Sep 7, 2022
b8061b5
Fix unwanted wrapping of HTML comments into p tags
kpot Sep 30, 2022
b4c02b8
Make headers h1-6 <br>eakable, as in PHP-Textile
kpot Sep 30, 2022
691a0f3
Fix the escaping of standalone ampersands
kpot Sep 30, 2022
a047b3b
Fix greedy space trimming, match it with PHP-textile
kpot Oct 1, 2022
adba701
Fix invalid parsing of nested lists of mixed types
kpot Oct 3, 2022
b270c0d
Fix improper inserts of <br> after <dd|dt|li> tags
kpot Oct 4, 2022
77cfcf8
Fix mishandling of extended notextile.. blocks
kpot Oct 5, 2022
d7ed71f
Fix quotes by porting PHP-textile`s tag shelving
kpot Oct 8, 2022
155e2b3
Fix multi-term definitions in lists. Port from PHP
kpot Oct 9, 2022
8c9f988
Fix coupling of $-links with link aliases
kpot Oct 14, 2022
05c59a7
Fix incorrect placement of <br> (ported from PHP)
kpot Oct 16, 2022
dd6c685
Fix forbidding invalid classes and ids in HTML
kpot Oct 16, 2022
a4d7008
Fix broken images, colgroups, captions in tables
kpot Oct 17, 2022
c344838
Fix confusion between cells with _em_ and heading
kpot Oct 17, 2022
1225abc
Fix unclosed <li> in undefined notes
kpot Oct 17, 2022
82157c7
Fix incorrect html in one of the tests
kpot Oct 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/fixtures/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@

When textile is not installed locally:</code></pre>

<pre>PYTHONPATH=. pytest</pre>
<pre><code>PYTHONPATH=. pytest</code></pre>
6 changes: 3 additions & 3 deletions tests/test_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

def test_span():
t = Textile()
result = t.span("hello %(bob)span *strong* and **bold**% goodbye")
result = t.retrieveTags(t.span("hello %(bob)span *strong* and **bold**% goodbye"))
expect = ('hello <span class="bob">span <strong>strong</strong> and '
'<b>bold</b></span> goodbye')
assert result == expect

result = t.span('%:http://domain.tld test%')
result = t.retrieveTags(t.span('%:http://domain.tld test%'))
expect = '<span cite="http://domain.tld">test</span>'
assert result == expect

t = Textile()
# cover the partial branch where we exceed the max_span_depth.
t.max_span_depth = 2
result = t.span('_-*test*-_')
result = t.retrieveTags(t.span('_-*test*-_'))
expect = '<em><del>*test*</del></em>'
assert result == expect
8 changes: 4 additions & 4 deletions tests/test_textile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ def test_Footnote():

def test_issue_35():
result = textile.textile('"z"')
expect = '\t<p>&#8220;z&#8221; </p>'
expect = '\t<p>&#8220;z&#8221;</p>'
assert result == expect

result = textile.textile('" z"')
expect = '\t<p>&#8220; z&#8221; </p>'
expect = '\t<p>&#8220; z&#8221;</p>'
assert result == expect

def test_restricted():
Expand Down Expand Up @@ -72,7 +72,7 @@ def test_restricted():
expect = '''\
\t<table>
\t<caption>Your caption goes here</caption>
\t

\t<tfoot>
\t\t<tr>
\t\t\t<td>A footer </td>
Expand Down Expand Up @@ -159,7 +159,7 @@ def test_endnotes_malformed():
def test_endnotes_undefined_note():
test = """Scientists say the moon is slowly shrinking[#my_first_label].\n\nnotelist!."""
html = textile.textile(test)
result_pattern = r"""\t<p>Scientists say the moon is slowly shrinking<sup><a href="#note([a-f0-9]{32})-2"><span id="noteref\1-1">1</span></a></sup>.</p>\n\n\t<ol>\n\t\t<li> Undefined Note \[#my_first_label\].<li>\n\t</ol>$"""
result_pattern = r"""\t<p>Scientists say the moon is slowly shrinking<sup><a href="#note([a-f0-9]{32})-2"><span id="noteref\1-1">1</span></a></sup>.</p>\n\n\t<ol>\n\t\t<li> Undefined Note \[#my_first_label\].</li>\n\t</ol>$"""
result_re = re.compile(result_pattern)
assert result_re.search(html) is not None

Expand Down
205 changes: 201 additions & 4 deletions tests/test_values.py

Large diffs are not rendered by default.

Loading