Skip to content

Commit

Permalink
Fix legacy --sprite-namespace format
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge Bastida committed Nov 29, 2013
1 parent e995bdf commit b8846c4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion glue/formats/css.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ def generate_css_name(self, filename):
# Add sprite namespace if required
if self.sprite.config['css_sprite_namespace']:
sprite_name = re.sub(r'[^\w\-_]', '', self.sprite.name)
namespace.insert(0, self.sprite.config['css_sprite_namespace'].format(sprite_name=sprite_name))
sprite_namespace = self.sprite.config['css_sprite_namespace']

# Support legacy 0.4 format
sprite_namespace = sprite_namespace.replace("%(sprite)s", "{sprite_name}")
namespace.insert(0, sprite_namespace.format(sprite_name=sprite_name))

# Add global namespace if required
if self.sprite.config['css_namespace']:
Expand Down

0 comments on commit b8846c4

Please sign in to comment.