1 2 3 | def dequote(arg):
"Given a list, will return a list with any leading and trailing quotes from the items in the list removed"
return [ ( arg[1:-1] if arg[0] == arg[-1] and arg[0] in ('"', "'") else arg ) for arg in args ]
|
More like this
- split_contents2 for template tags by bl4th3rsk1t3 3 years, 11 months ago
- "Youtube watch link to embed" custom tag. by I159 1 year, 7 months ago
- Convert Microsoft "smart quotes" to standard quotes by nomadjourney 2 years, 7 months ago
- keywords arguments parser for custom template tags by bruno 4 years, 4 months ago
- Parse TemplateTag Variables Safely by evan_schulz 4 years, 10 months ago
Comments