diff --git a/otc_doc_convertor/comparator.py b/otc_doc_convertor/comparator.py index 6369489e..69014754 100644 --- a/otc_doc_convertor/comparator.py +++ b/otc_doc_convertor/comparator.py @@ -13,6 +13,10 @@ def body_filter(tag): ) +def simplify_body(data): + return data.get_text().replace(" ", "") + + class OTCComparator: def compare(self, url_prefix, file_path, file_name): @@ -35,7 +39,7 @@ class OTCComparator: t1 = original.find(body_filter) t2 = new.find(body_filter) if t1 != t2: - if t1.get_text() == t2.get_text(): + if simplify_body(t1) == simplify_body(t2): logging.error( "File %s is not matching, but " "plain text matches" % file_name)