Commits

Anonymous committed b581457

[svn] synced text helper from latest Rails version

Comments (0)

Files changed (2)

 WebHelpers ChangeLog
 
 0.2.1 (**svn**)
+* Sync'd text helper from latest Rails version.
+* Fixed form tag's method matching to be case insensitive.
 
 0.2 (8/31/06)
 * Adding simplejson req, adding use of json'ification. Updated scriptaculous

webhelpers/rails/text.py

 """
 Text Helpers
 """
-# Last synced with Rails copy at Revision 4595 on Aug 19th, 2006.
+# Last synced with Rails copy at Revision 4896 on Sep 1st, 2006.
 # Purposely left out sanitize, should be included at some point likely using
 # BeautifulSoup.
 
 import webhelpers.markdown as markdown
 import itertools, re
 
-AUTO_LINK_RE = re.compile("""(<\w+.*?>|[^=!:'"\/]|^)((?:http[s]?:\/\/)|(?:www\.))(([\w]+:?[=?&\/.-]?)*\w+[\/]?(?:\#\w*)?)([\.,"'?!;:]|\s|<|$)""")
+AUTO_LINK_RE = re.compile(r"""(<\w+.*?>|[^=!:'"/]|^)((?:https?://)|(?:www\.))([-\w]+(?:\.[-\w]+)*(?::\d+)?(?:/(?:[~\w%.;-]+)?)*(?:\?[\w%&=.;-]+)?(?:\#\w*)?)([\.,"'?!;:]|\s|<|$)""")
     
 def iterdict(items):
     return dict(items=items, iter=itertools.cycle(items))
     extra_options = tag_options(**href_options)
     def handle_match(matchobj):
         all = matchobj.group()
-        a, b, c, d = matchobj.group(1,2,3,5)
+        a, b, c, d = matchobj.group(1,2,3,4)
         if re.match(r'<a\s', a, re.I):
             return all
         text = b + c
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.