Created
May 20, 2013 21:54
-
-
Save onyxfish/5615894 to your computer and use it in GitHub Desktop.
Part of our SVG processing that normalizes the input before its passed to cairosvg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
svg = request.form.get('image', None) | |
svg = re.sub('(height|width)=\"[0-9]+\"', '', svg, 2) | |
# Fix for duplicate namespaces in IE... | |
if svg.count('xmlns="http://www.w3.org/2000/svg"') > 1: | |
svg = svg.replace('xmlns="http://www.w3.org/2000/svg"', '', 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment