aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/__init__.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2012-05-03 18:47:28 +0000
committerWaylan Limberg <waylan@gmail.com>2012-05-03 18:47:28 +0000
commitc64c19676e14f3177b3d0e7e0532c24d48958ec8 (patch)
treef01a92e63a8bdf1f53b4757d54a4cca004add3e6 /markdown/__init__.py
parent4d2b83bfa01f218ae10cc20044c9636110a9baf2 (diff)
downloadmarkdown-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.
Diffstat (limited to 'markdown/__init__.py')
-rw-r--r--markdown/__init__.py4
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