From 8b882ca3c994f9b3fce7cd95bd927dec17e5ce38 Mon Sep 17 00:00:00 2001 From: SimonIT Date: Mon, 10 Aug 2020 16:24:00 +0200 Subject: [PATCH 1/6] Add some fancy badges --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index 4e93b92..9becee1 100644 --- a/README.rst +++ b/README.rst @@ -1,3 +1,7 @@ +.. image:: https://img.shields.io/pypi/v/markdownify :alt: PyPI +.. image:: https://img.shields.io/pypi/l/markdownify :alt: PyPI - License +.. image:: https://img.shields.io/pypi/dm/markdownify :alt: PyPI - Downloads + Installation ============ From 28d7a22da3710310182850bd3d4350eab7aea699 Mon Sep 17 00:00:00 2001 From: SimonIT Date: Mon, 10 Aug 2020 17:42:18 +0200 Subject: [PATCH 2/6] Remove alt because it makes some trouble --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 9becee1..2769146 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ -.. image:: https://img.shields.io/pypi/v/markdownify :alt: PyPI -.. image:: https://img.shields.io/pypi/l/markdownify :alt: PyPI - License -.. image:: https://img.shields.io/pypi/dm/markdownify :alt: PyPI - Downloads +.. image:: https://img.shields.io/pypi/v/markdownify +.. image:: https://img.shields.io/pypi/l/markdownify +.. image:: https://img.shields.io/pypi/dm/markdownify Installation ============ From 04711027e639c699b1fddc79c8b5faaf3665a1e4 Mon Sep 17 00:00:00 2001 From: SimonIT Date: Thu, 13 Aug 2020 20:11:18 +0200 Subject: [PATCH 3/6] Replace downloads badge --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 2769146..299d214 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ .. image:: https://img.shields.io/pypi/v/markdownify .. image:: https://img.shields.io/pypi/l/markdownify -.. image:: https://img.shields.io/pypi/dm/markdownify +.. image:: https://pepy.tech/badge/markdownify Installation ============ From a4461161bc6a2c1860d825aaa64c2a04bfbf5c53 Mon Sep 17 00:00:00 2001 From: SimonIT Date: Wed, 19 Aug 2020 10:06:21 +0200 Subject: [PATCH 4/6] Make badges inline --- README.rst | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 299d214..4d21411 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,20 @@ -.. image:: https://img.shields.io/pypi/v/markdownify -.. image:: https://img.shields.io/pypi/l/markdownify -.. image:: https://pepy.tech/badge/markdownify +|build| |version| |license| |downloads| + +.. |build| image:: https://img.shields.io/github/workflow/status/matthewwithanm/python-markdownify/Python%20application/develop + :alt: GitHub Workflow Status + :target: https://github.com/matthewwithanm/python-markdownify/actions?query=workflow%3A%22Python+application%22 + +.. |version| image:: https://img.shields.io/pypi/v/markdownify + :alt: Pypi version + :target: https://pypi.org/project/markdownify/ + +.. |license| image:: https://img.shields.io/pypi/l/markdownify + :alt: License + :target: https://github.com/matthewwithanm/python-markdownify/blob/develop/LICENSE + +.. |downloads| image:: https://pepy.tech/badge/markdownify + :alt: Pypi Downloads + :target: https://pepy.tech/project/markdownify Installation ============ From 1b3136ad04179736755f1fb71b5023ca97083a32 Mon Sep 17 00:00:00 2001 From: SimonIT Date: Mon, 31 Aug 2020 13:15:10 +0200 Subject: [PATCH 5/6] Fix parsing corrupt html --- markdownify/__init__.py | 8 +------- tests/test_conversions.py | 4 ++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/markdownify/__init__.py b/markdownify/__init__.py index 33d5b8f..2d5daf1 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -6,8 +6,6 @@ import six convert_heading_re = re.compile(r'convert_h(\d+)') line_beginning_re = re.compile(r'^', re.MULTILINE) whitespace_re = re.compile(r'[\r\n\s\t ]+') -FRAGMENT_ID = '__MARKDOWNIFY_WRAPPER__' -wrapped = '
%%s
' % FRAGMENT_ID # Heading styles @@ -62,12 +60,8 @@ class MarkdownConverter(object): ' convert, but not both.') def convert(self, html): - # We want to take advantage of the html5 parsing, but we don't actually - # want a full document. Therefore, we'll mark our fragment with an id, - # create the document, and extract the element with the id. - html = wrapped % html soup = BeautifulSoup(html, 'html.parser') - return self.process_tag(soup.find(id=FRAGMENT_ID), children_only=True) + return self.process_tag(soup, children_only=True) def process_tag(self, node, children_only=False): text = '' diff --git a/tests/test_conversions.py b/tests/test_conversions.py index 9e7be24..12ce36b 100644 --- a/tests/test_conversions.py +++ b/tests/test_conversions.py @@ -157,3 +157,7 @@ def test_bullets(): def test_img(): assert md('Alt text') == '![Alt text](/path/to/img.jpg "Optional title")' assert md('Alt text') == '![Alt text](/path/to/img.jpg)' + + +def test_div(): + assert md('Hello World') == 'Hello World' From 25d68b4265071402f3addf0f35db040ae87c5864 Mon Sep 17 00:00:00 2001 From: AlexVonB Date: Tue, 1 Sep 2020 18:09:24 +0200 Subject: [PATCH 6/6] Bump version 0.5.3 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 06ab404..a3cf276 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read() pkgmeta = { '__title__': 'markdownify', '__author__': 'Matthew Tretter', - '__version__': '0.5.2', + '__version__': '0.5.3', }