diff --git a/app/converter/wordpress_markdown.py b/app/converter/wordpress_markdown.py index 1a58bd9..9eba560 100644 --- a/app/converter/wordpress_markdown.py +++ b/app/converter/wordpress_markdown.py @@ -51,7 +51,10 @@ class WordpressMarkdownConverter: header["author"] = self.configurator.converter_options.author_rewrite return header - def remove_html_tags(self, post_lines): + def fix_html_tags(self, post_lines): + """ + Fixes the html tags from the post lines. + """ fixed_lines = [] for line in post_lines: if line == "": @@ -77,7 +80,7 @@ class WordpressMarkdownConverter: else: tags = list(map(str, content.contents)) if tags: - fixed_tags = self.remove_html_tags(tags) + fixed_tags = self.fix_html_tags(tags) if fixed_tags: fixed_lines.extend(fixed_tags) @@ -105,7 +108,7 @@ class WordpressMarkdownConverter: # fix unknown tags post_lines = post_content.split("\n") - fixed_lines = self.remove_html_tags(post_lines) + fixed_lines = self.fix_html_tags(post_lines) return "\n".join(fixed_lines) diff --git a/app/tests/converter/wordpress_markdown_test.py b/app/tests/converter/wordpress_markdown_test.py index a36d2ef..57c46ca 100644 --- a/app/tests/converter/wordpress_markdown_test.py +++ b/app/tests/converter/wordpress_markdown_test.py @@ -62,10 +62,10 @@ def test_header_fields_drop(header_fields_drop, input_header, expected_header): ), ], ) -def test_remove_html_tags_detect_youtube_links(input_lines, expected_lines): +def test_fix_html_tags_detect_youtube_links(input_lines, expected_lines): configurator = make_fake_configurator( "wordpress_markdown_converter", ConverterOptions(), ) converter = WordpressMarkdownConverter(configurator) - assert converter.remove_html_tags(input_lines) == expected_lines + assert converter.fix_html_tags(input_lines) == expected_lines