Permalink
Browse files

fix zenify: handle tabs and newlines in ids and classes

  • Loading branch information...
1 parent 6a47304 commit 3aca1255d8fa8dbe09dd7bff9d48c0a9627616a7 @fmarcia committed May 26, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 zencoding/html_navigation.py
@@ -244,9 +244,9 @@ def zenify(self, content, mode):
for grand_child in child.children:
if grand_child.type == 'value' and grand_child.start < grand_child.end and not grand_child.children:
if name == 'id':
- zen_id = '#' + content[grand_child.start:grand_child.end]
+ zen_id = '#' + '#'.join(filter(lambda s: s, re.split('\s+', content[grand_child.start:grand_child.end])))
elif name == 'class':
- zen_class = '.' + '.'.join(filter(lambda s: s, re.split(' +', content[grand_child.start:grand_child.end])))
+ zen_class = '.' + '.'.join(filter(lambda s: s, re.split('\s+', content[grand_child.start:grand_child.end])))
elif mode > 1 and child.type == 'attribute':
for grand_child in child.children:

0 comments on commit 3aca125

Please sign in to comment.