Last active
September 25, 2022 23:01
-
-
Save rahulbanerjee26/cff9b71e7f099d54782320231e6a325c to your computer and use it in GitHub Desktop.
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
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