Commits

Sebastian Hanula committed 2bd7961

Allow slash characters in auto_link() query string.

  • Participants
  • Parent commits 3032f5d

Comments (0)

Files changed (3)

     Alexandre Bourget.
 * webhelpers.html.tools:
   - New helper ``strip_tags()`` deletes HTML tags in a string.
+  - Fixed ``auto_link()`` to parse slash characters in query string.
 * webhelpers.paginate:
   - convert "_range" and "_pagelink" function to Page class method so that they
     can be overridden

tests/test_tools.py

             literal('http://www.pylonshq.com/contact;new%20with%20spaces'),
             literal('http://www.pylonshq.com/contact;new?with=query&string=params'),
             literal('http://www.pylonshq.com/~minam/contact;new?with=query&string=params'),
-            literal('http://en.wikipedia.org/wiki/Wikipedia:Today%27s_featured_picture_%28animation%29/January_20%2C_2007')
+            literal('http://en.wikipedia.org/wiki/Wikipedia:Today%27s_featured_picture_%28animation%29/January_20%2C_2007'),
+            literal('http://www.pylonshq.com/foo.cgi?date=01/01/01')
             ]
         for url in urls:
             self.assertEqual('<a href="%s">%s</a>' % (url, url),

webhelpers/html/tools.py

                           (?:\.[-\w]+)*            # remaining subdomains or domain
                           (?::\d+)?                # port
                           (?:/(?:(?:[~\w\+%-]|(?:[,.;:][^\s$]))+)?)* # path
-                          (?:\?[\w\+%&=.;-]+)?     # query string
+                          (?:\?[\w\+\/%&=.;-]+)?     # query string
                           (?:\#[\w\-]*)?           # trailing anchor
                         )
                         ([\.,"'?!;:]|\s|<|$)       # trailing text