From bbfabf53129445a9be876a11ead38178a7f85b48 Mon Sep 17 00:00:00 2001 From: Mayur Dhamanwala Date: Thu, 7 Jul 2016 10:51:46 +1000 Subject: [PATCH] Fixing the Bulletin Builder Foramtter for line break. --- .../aap/publish/formatters/aap_bulletinbuilder_formatter.py | 2 +- .../publish/formatters/aap_bulletinbuilder_formatter_tests.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/aap/publish/formatters/aap_bulletinbuilder_formatter.py b/server/aap/publish/formatters/aap_bulletinbuilder_formatter.py index da61ffe03..22193ecf0 100644 --- a/server/aap/publish/formatters/aap_bulletinbuilder_formatter.py +++ b/server/aap/publish/formatters/aap_bulletinbuilder_formatter.py @@ -72,7 +72,7 @@ def can_format(self, format_type, article): return format_type == 'AAP BULLETIN BUILDER' def get_text_content(self, content): - content.replace('
', '
').replace('
', '') + content = content.replace('
', '
').replace('
', '') soup = BeautifulSoup(content, 'html.parser') for top_level_tag in soup.find_all(recursive=False): diff --git a/server/aap/publish/formatters/aap_bulletinbuilder_formatter_tests.py b/server/aap/publish/formatters/aap_bulletinbuilder_formatter_tests.py index 30c5fb6bb..443e3d6ec 100644 --- a/server/aap/publish/formatters/aap_bulletinbuilder_formatter_tests.py +++ b/server/aap/publish/formatters/aap_bulletinbuilder_formatter_tests.py @@ -247,9 +247,9 @@ def test_strip_html_mixed_tags(self): def test_takes_package(self): html = ('

Para1: A tropical cyclone is a rapidly rotating storm system

' '

Para2: Tropical refers to the geographical origin of these systems

' - '
' + '
' '

Para3:Tropical refers to the geographical origin of these systems

' - '
' + '
' '

Para4:Tropical refers to the geographical origin of these systems

') formatted_content = self._formatter.get_text_content(html)