From c64c19676e14f3177b3d0e7e0532c24d48958ec8 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 3 May 2012 18:47:28 +0000 Subject: 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. --- markdown/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3