Skip to content
Browse files

Removed platform-dependent regexp in Page#build_meta().

  • Loading branch information...
1 parent 603bd6d commit a5fcdf84ab441d2ed7a34299fa1ff671c40a0e98 @remram44 remram44 committed
Showing with 3 additions and 5 deletions.
  1. +3 −5 wok/page.py
View
8 wok/page.py
@@ -285,11 +285,9 @@ def build_meta(self):
logging.debug('current page: ' + repr(parts['page']))
# Pull extensions from the template's real file name.
- match = re.match('.*/[^\.]*\.(.*)$', self.template.filename)
- if match:
- parts['ext'] = match.groups()[0]
- else:
- parts['ext'] = ''
+ parts['ext'] = os.path.splitext(self.template.filename)[1]
+ if parts['ext']:
+ parts['ext'] = parts['ext'][1:] # remove leading dot
# Deprecated
parts['type'] = parts['ext']
self.meta['ext'] = parts['ext']

0 comments on commit a5fcdf8

Please sign in to comment.
Something went wrong with that request. Please try again.