Created
November 1, 2021 17:45
-
-
Save CribberSix/8019d9986a51aff6773bd44f5fe834c8 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 remove_code_blocks(content: List[str]) -> List[str]: | |
content_cleaned = [] | |
code_block = False | |
for x in content: | |
# detect code blocks, act accordingly | |
if x[:3] == '```': | |
code_block = not code_block | |
elif not code_block: | |
content_cleaned.append(x) | |
return content_cleaned |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment