Skip to content

Instantly share code, notes, and snippets.

@renatooliveira
Created July 8, 2013 03:07
Show Gist options
  • Select an option

  • Save renatooliveira/5945951 to your computer and use it in GitHub Desktop.

Select an option

Save renatooliveira/5945951 to your computer and use it in GitHub Desktop.
def get_formatted_text(self):
"""
Method used to format all gist snippets from the post.
Thanks @marcelcaraciolo.
"""
text = re.sub(
r'{{<a href=\"(.*?)\">(.*?)</a>}}',
r'<script src="\1.js"></script>',
self.text
)
return text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment