Skip to content

Instantly share code, notes, and snippets.

@rahulbanerjee26
Last active September 25, 2022 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulbanerjee26/cff9b71e7f099d54782320231e6a325c to your computer and use it in GitHub Desktop.
Save rahulbanerjee26/cff9b71e7f099d54782320231e6a325c to your computer and use it in GitHub Desktop.
def getCodeSnippetsFromMarkdown(content):
start_pat = "```(.*?)\n"
end_pat = "```"
snippets = re.findall(start_pat + "(.*?)" + end_pat, content, re.S)
result = []
for item in snippets:
if item[0] != "bash":
result.append(getSnippetName(item[0], item[1]))
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment