diff options
author | Waylan Limberg <waylan@gmail.com> | 2012-05-03 18:47:28 +0000 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2012-05-03 18:47:28 +0000 |
commit | c64c19676e14f3177b3d0e7e0532c24d48958ec8 (patch) | |
tree | f01a92e63a8bdf1f53b4757d54a4cca004add3e6 | |
parent | 4d2b83bfa01f218ae10cc20044c9636110a9baf2 (diff) | |
download | markdown-c64c19676e14f3177b3d0e7e0532c24d48958ec8.tar.gz markdown-c64c19676e14f3177b3d0e7e0532c24d48958ec8.tar.bz2 markdown-c64c19676e14f3177b3d0e7e0532c24d48958ec8.zip |
Fixed #82. 'enable_attributes' honors 'safe_mode'.
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.
-rw-r--r-- | markdown/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/markdown/__init__.py b/markdown/__init__.py index 3100901..629d5b7 100644 --- a/markdown/__init__.py +++ b/markdown/__init__.py @@ -122,6 +122,10 @@ class Markdown: 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 |