From 782ee338c9783a49d55c4f092ac0926e2892cf1f Mon Sep 17 00:00:00 2001 From: SaadYousaf Date: Wed, 16 Feb 2022 13:34:47 +0500 Subject: [PATCH] fix: remove pre tag processing for course import --- common/lib/xmodule/xmodule/raw_module.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/common/lib/xmodule/xmodule/raw_module.py b/common/lib/xmodule/xmodule/raw_module.py index cf349efbd8..ad033204e4 100644 --- a/common/lib/xmodule/xmodule/raw_module.py +++ b/common/lib/xmodule/xmodule/raw_module.py @@ -24,21 +24,7 @@ class RawMixin: @classmethod def definition_from_xml(cls, xml_object, system): # lint-amnesty, pylint: disable=missing-function-docstring, unused-argument - try: - data = etree.tostring(xml_object, pretty_print=True, encoding='unicode') - pre_tag_data = [] - for pre_tag_info in xml_object.findall('.//pre'): - if len(pre_tag_info.findall('.//pre')) == 0: - pre_tag_data.append(etree.tostring(pre_tag_info)) - - if pre_tag_data: - matches = re.finditer(PRE_TAG_REGEX, data) - for match_num, match in enumerate(matches): - data = re.sub(match.group(), pre_tag_data[match_num].decode(), data) - etree.XML(data) # it just checks if generated string is valid xml - return {'data': data}, [] - except etree.XMLSyntaxError: - return {'data': etree.tostring(xml_object, pretty_print=True, encoding='unicode')}, [] + return {'data': etree.tostring(xml_object, pretty_print=True, encoding='unicode')}, [] def definition_to_xml(self, resource_fs): # lint-amnesty, pylint: disable=unused-argument """