1. Ben Bangert
  2. WebHelpers


pjenvey  committed b581457

[svn] synced text helper from latest Rails version

  • Participants
  • Parent commits a87afce
  • Branches trunk

Comments (0)

Files changed (2)


View file
 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

File webhelpers/rails/text.py

View file
 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