Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions CommonMark/CommonMark.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@

# Utility functions

def ASTtoJSON(block):
""" Output AST in JSON form, this is destructive of block."""
def ASTtoJSON(iblock):
from copy import deepcopy
block=deepcopy(iblock)
del deepcopy
def prepare(block):
""" Strips circular 'parent' references and trims empty block elements."""
if block.parent:
Expand Down Expand Up @@ -1377,4 +1379,4 @@ def renderBlocks(self, blocks, in_tight_list=None):

def render(self, block, in_tight_list=None):
""" Pass through for renderBlock"""
return self.renderBlock(block, in_tight_list)
return self.renderBlock(block, in_tight_list)