Commits

pjenvey  committed b744496

[svn] Fixed auto_link to parse more valid url formats
fixes #100
(Thanks Jamie Wilkinson)

  • Participants
  • Parent commits b581457

Comments (0)

Files changed (2)

 WebHelpers ChangeLog
 
 0.2.1 (**svn**)
+* Fixed auto_link to parse more valid url formats (Thanks Jamie Wilkinson).
 * Sync'd text helper from latest Rails version.
 * Fixed form tag's method matching to be case insensitive.
 

File webhelpers/rails/text.py

 import webhelpers.markdown as markdown
 import itertools, re
 
-AUTO_LINK_RE = re.compile(r"""(<\w+.*?>|[^=!:'"/]|^)((?:https?://)|(?:www\.))([-\w]+(?:\.[-\w]+)*(?::\d+)?(?:/(?:[~\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))