summaryrefslogtreecommitdiff
path: root/django/utils/html.py
AgeCommit message (Collapse)Author
2013-09-06Fixed a number of flake8 errors -- particularly around unused imports and ↵Alex Gaynor
local variables
2013-09-05Took advantage of django.utils.six.moves.urllib.*.Aymeric Augustin
2013-08-30Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette
2013-07-28Simplified smart_urlquote and added some basic tests.Florian Apolloner
2013-06-19Removed several unused imports.Aymeric Augustin
2013-05-23Fixed #19237 (again) - Made strip_tags consistent between Python versionsClaude Paroz
2013-05-22Fixed #19237 -- Used HTML parser to strip tagsClaude Paroz
The regex method used until now for the strip_tags utility is fast, but subject to flaws and security issues. Consensus and good practice lead use to use a slower but safer method.
2013-05-18Fixed #20246 -- Added non-breaking spaces between values an unitsEmil Stenström
2013-05-17Replaced an antiquated pattern.Aymeric Augustin
Thanks Lennart Regebro for pointing it out.
2013-04-01Fixed #20172 -- Ensured urlize supports IPv4/IPv6 addressesClaude Paroz
Thanks Marc Aymerich for the report and the initial patch.
2013-02-06Improved regex in strip_tagsClaude Paroz
Thanks Pablo Recio for the report. Refs #19237.
2013-01-25Fixed #19577 - Added HTML escaping to admin examples.Tim Graham
Thanks foo@ for the report and Florian Apolloner for the review.
2012-12-03cope with unsplittable urls in smarl_urlquote.Tom Insam
2012-11-24Fixed #19237 -- Improved strip_tags utilityChris Khoo
The previous pattern didn't properly addressed cases where '>' was present inside quoted tag content.
2012-10-31Fixed #19070 -- urlize filter no longer raises exceptions on 2.7Andrew Godwin
Thanks to claudep for the patch.
2012-09-18Use unicode.translate to speed up js escaping.Dave Hall
2012-08-29Replaced many smart_bytes by force_bytesClaude Paroz
In all those occurrences, we didn't care about preserving the lazy status of the strings, but we really wanted to obtain a real bytestring.
2012-08-18[py3] Made 212b9826bd Python 3-friendlyAymeric Augustin
2012-08-18Fixed #14516 -- Extract methods from removetags and slugify template filtersMarc Tamlyn
Patch by @jphalip updated to apply, documentation and release notes added. I've documented strip_tags as well as remove_tags as the difference between the two wouldn't be immediately obvious.
2012-08-11[py3] Re-decoded string after idna encodingClaude Paroz
2012-08-07[py3] Ported django.utils.encoding.Aymeric Augustin
* Renamed smart_unicode to smart_text (but kept the old name under Python 2 for backwards compatibility). * Renamed smart_str to smart_bytes. * Re-introduced smart_str as an alias for smart_text under Python 3 and smart_bytes under Python 2 (which is backwards compatible). Thus smart_str always returns a str objects. * Used the new smart_str in a few places where both Python 2 and 3 want a str.
2012-08-07[py3] Fixed access to dict keys/values/items.Aymeric Augustin
2012-08-03Remove a temporary variable deletion, it's not a big deal and it doesn't ↵Alex Gaynor
exist on python3.
2012-07-25Merge pull request #216 from ljosa/ticket_18644Florian Apolloner
Fixed #18644 -- Made urlize trim trailing period followed by parenthesis
2012-07-22[py3] Updated urllib/urllib2/urlparse imports.Aymeric Augustin
Lots of functions were moved. Use explicit imports in all cases to keey it easy to identify where the functions come from.
2012-07-22[py3] Replaced unicode/str by six.text_type/bytes.Aymeric Augustin
2012-07-17Fixed #18644 -- Made urlize trim trailing period followed by parenthesisVebjorn Ljosa
2012-07-03Added 'format_html' utility for formatting HTML fragments safelyLuke Plant
2012-07-03Documented utils.html.escape and conditional_escapeLuke Plant
2012-06-07Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
2012-05-19Marked bytestrings with b prefix. Refs #18269Claude Paroz
This is a preparation for unicode literals general usage in Django (Python 3 compatibility).
2012-04-11Fixed #18071 -- Ignored case sensitivity in urlize utility. Thanks ↵Claude Paroz
luke@creaturecreative.com and adamzap for the report and the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-04Fixed #17592 -- Handle URLs starting with a dot when using urlize. Thanks, ↵Jannis Leidel
Claude Paroz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17435 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-03Small fix to comments in utils/html.py from [17347]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17424 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-08Reverted parts of r17359 that could cause false positives in URL detection, ↵Aymeric Augustin
especially on file names. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-08Fixed #11911 -- Made the urlize filter smarter with closing punctuation.Aymeric Augustin
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17362 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-08Fixed #16656 -- Changed the urlize filter to accept more top-level domains.Aymeric Augustin
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17359 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-08Fixed #16395 -- Prevented urlize from highlighting some malformed URLs. ↵Aymeric Augustin
Thanks BernhardEssl for the report and initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17358 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-08Fixed #12183 -- Made the urlize filter insert the nofollow attribute ↵Aymeric Augustin
properly when an http: URL occurs after a mailto: URL. Thanks eronen for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17356 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-07Fixed #13704 -- Handled IDN properly in the urlize template filter. Thanks ↵Aymeric Augustin
Claude Paroz for the initial version of the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17348 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-07Fixed #9655 -- Prevented the urlize template filter from double-quoting ↵Aymeric Augustin
URLs. Thanks Claude Paroz for writing the tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17347 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-29Fixed #14288 -- Fixed linebreaksbr template filter to normalize newlines ↵Jannis Leidel
first. Thanks, Julien Phalip. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16573 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-28Fixed #7267 - UnicodeDecodeError in clean_htmlLuke Plant
Thanks to Nikolay for the report, and gav and aaugustin for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16118 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-02Fixed #2986 -- Made the JavaScript code that drives related model instance ↵Ramiro Morales
addition in a popup window handle a model representation containing new lines. Also, moved the escapejs functionality yoo django.utils.html so it can be used from Python code. Thanks andrewwatts for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15131 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-03Fixed a whole bunch of small docs typos, errors, and ommissions.Jacob Kaplan-Moss
Fixes #8358, #8396, #8724, #9043, #9128, #9247, #9267, #9267, #9375, #9409, #9414, #9416, #9446, #9454, #9464, #9503, #9518, #9533, #9657, #9658, #9683, #9733, #9771, #9835, #9836, #9837, #9897, #9906, #9912, #9945, #9986, #9992, #10055, #10084, #10091, #10145, #10245, #10257, #10309, #10358, #10359, #10424, #10426, #10508, #10531, #10551, #10635, #10637, #10656, #10658, #10690, #10699, #19528. Thanks to all the respective authors of those tickets. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30Fixed #9883: no longer do strange things with whitespace in the linebreaks ↵Jacob Kaplan-Moss
filter. Thanks, keithb. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10225 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19Fixed #6965 -- Sped up the urlize and urlizetrunc filters. A nice patch from ↵Malcolm Tredinnick
Andrew Badr. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26Fixed #7542 -- Fixed bug in urlize where it was appending 'http://' to the ↵Adrian Holovaty
link text. Thanks for the patch and tests, devin git-svn-id: http://code.djangoproject.com/svn/django/trunk@7755 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-19Fixed #7355 -- Modified urlize utility to handle https:// addresses. Thanks ↵Russell Keith-Magee
for the report and patch, clint. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-03Fixed #6279, #6514 -- Fixed some HTML escaping problems in the urlize filter.Malcolm Tredinnick
Based on a patch from SmileyChris with some test additions from Rob Hudson. Thanks, both. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7079 bcc190cf-cafb-0310-a4f2-bffc1f526a37