Changeset 319
- Timestamp:
- 07/02/09 15:58:36 (4 years ago)
- Location:
- enpraxis.staticsite/trunk/enpraxis/staticsite
- Files:
-
- 2 edited
-
tests/test_unit_staticutility.py (modified) (1 diff)
-
utilities/staticsiteutility.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
enpraxis.staticsite/trunk/enpraxis/staticsite/tests/test_unit_staticutility.py
r318 r319 17 17 def test_filterDocumentLink(self): 18 18 """ Test combined document filter functions """ 19 ssutil = getUtility(IStaticSiteUtility) 20 link = ssutil.filterDocumentLink('#TOP', '', None, []) 21 self.assertEqual(link, '#TOP') 22 link = ssutil.filterDocumentLink('javascript:void(0);', '', None, []) 23 self.assertEqual(link, 'javascript:void(0);') 24 19 25 20 26 def test_convertLinkToAbsolute(self): -
enpraxis.staticsite/trunk/enpraxis/staticsite/utilities/staticsiteutility.py
r317 r319 468 468 def filterDocumentLink(self, link, current, portal, views): 469 469 lnk = link 470 lnk = self._convertLinkToAbsolute(lnk, current) 471 lnk = self._convertObjectLink(lnk, portal, views) 472 lnk = self._convertLinkToRelative(lnk, current) 470 url = urlparse(lnk) 471 if url[2] and 'javascript' != url[0]: 472 lnk = self._convertLinkToAbsolute(lnk, current) 473 lnk = self._convertObjectLink(lnk, portal, views) 474 lnk = self._convertLinkToRelative(lnk, current) 473 475 return lnk 474 476 … … 512 514 if view: 513 515 path = '/'.join(h) + '-%s.html' %view 516 elif h: 517 path = '/'.join(h) + '.html' 514 518 else: 515 path = ' /'.join(h) + '.html'519 path = '' 516 520 result = urlunparse((hr[0], hr[1], path, hr[3], hr[4], hr[5])) 517 521 return result
Note: See TracChangeset
for help on using the changeset viewer.
