Skip to content

Commit

Permalink
Fixed #82. 'enable_attributes' honors 'safe_mode'.
Browse files Browse the repository at this point in the history
Note that you can still explicitly set 'enable_attributes' and that
value will be honored regardless of 'safe_mode'. However if 'safe_mode'
is on and 'enable_attributes' is not explicitly set, then
'enable_attributes' defaults to False.
  • Loading branch information
Waylan Limberg committed May 3, 2012
1 parent 4d2b83b commit c64c196
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions markdown/__init__.py
Expand Up @@ -122,6 +122,10 @@ def __init__(self, *args, **kwargs):
setattr(self, option, kwargs.get(option, default))

self.safeMode = kwargs.get('safe_mode', False)
if self.safeMode and not kwargs.has_key('enable_attributes'):
# Disable attributes in safeMode when not explicitly set
self.enable_attributes = False

self.registeredExtensions = []
self.docType = ""
self.stripTopLevelTags = True
Expand Down

0 comments on commit c64c196

Please sign in to comment.