One function
convert_quotes in justinmayer/smartypants.py
The author described this change as “Fix double closing quotes after an HTML block”. It counts as a record because the check below fails on the code as it stood at c46d26c55 and passes on e0404a136, with nothing else changed between the two runs.
Projectjustinmayer/smartypants.py
Fix saved2018-05-19
Sharing licenceBSD-2-Clause · COPYING
Change size+7 −0
What the code was meant to do, written into the code itself as a docstring
Convert quotes in *text* into HTML curly quote entities. “Isn’t this fun?”
The change
| 81 | 81 | text = closing_double_quotes_regex.sub('”', text) | |
| 82 | 82 | ||
| 83 | 83 | closing_double_quotes_regex = re.compile(r""" | |
| 84 | + | ^ | |
| 85 | + | " | |
| 86 | + | (?=%s) | |
| 87 | + | """ % (punct_class,), re.VERBOSE) | |
| 88 | + | text = closing_double_quotes_regex.sub('”', text) | |
| 89 | + | ||
| 90 | + | closing_double_quotes_regex = re.compile(r""" | |
| 84 | 91 | (%s) # character that indicates the quote should be closing | |
| 85 | 92 | " | |
| 86 | 93 | """ % (close_class,), re.VERBOSE) |
The check that tells the two apart
fail→pass·tests/test.py::SmartyPantsTestCase::test_quotes_and_html
Check file tests/test.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itc46d26c559d706b6e0aa423190ab2d6edf1fdfcd
Broken version dated2017-12-24
Modulesmartypants
Units changedconvert_quotes
Fingerprint894dc9f54b806038
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in justinmayer/smartypants.py
- 2013-09-21_tokenize
- 2013-09-19_tokenize
- 2013-08-12fix convert_quote, it was also turned on since False != "0"