From 0e4405b79352408b61ddc2f837ae6582e323385e Mon Sep 17 00:00:00 2001 From: Chase choi Date: Mon, 6 Jul 2015 14:45:17 -0700 Subject: [PATCH] Update html5parser.py If self.parser.phase and self.parser.phases["inForeignContent"] are equal then don't need to allocate it again. --- html5lib/html5parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html5lib/html5parser.py b/html5lib/html5parser.py index c0855362d..f5808b224 100644 --- a/html5lib/html5parser.py +++ b/html5lib/html5parser.py @@ -1209,7 +1209,7 @@ def startTagMath(self, token): #has a namespace not equal to the xmlns attribute if self.parser.phase != self.parser.phases["inForeignContent"]: self.parser.secondaryPhase = self.parser.phase - self.parser.phase = self.parser.phases["inForeignContent"] + self.parser.phase = self.parser.phases["inForeignContent"] if token["selfClosing"]: self.tree.openElements.pop() token["selfClosingAcknowledged"] = True @@ -1224,7 +1224,7 @@ def startTagSvg(self, token): #has a namespace not equal to the xmlns attribute if self.parser.phase != self.parser.phases["inForeignContent"]: self.parser.secondaryPhase = self.parser.phase - self.parser.phase = self.parser.phases["inForeignContent"] + self.parser.phase = self.parser.phases["inForeignContent"] if token["selfClosing"]: self.tree.openElements.pop() token["selfClosingAcknowledged"] = True