diff --git a/README.rst b/README.rst
index 4d6db8e..7fa0b19 100644
--- a/README.rst
+++ b/README.rst
@@ -110,6 +110,18 @@ Options may be specified as kwargs to the ``markdownify`` function, or as a
nested ``Options`` class in ``MarkdownConverter`` subclasses.
+Converting BeautifulSoup objects
+================================
+
+.. code:: python
+
+ from markdownify import MarkdownConverter
+
+ # Create shorthand method for conversion
+ def md(soup, **options):
+ return ImageBlockConverter(**options).convert_soup(soup)
+
+
Creating Custom Converters
==========================
diff --git a/markdownify/__init__.py b/markdownify/__init__.py
index 098c784..82262d4 100644
--- a/markdownify/__init__.py
+++ b/markdownify/__init__.py
@@ -96,6 +96,9 @@ class MarkdownConverter(object):
def convert(self, html):
soup = BeautifulSoup(html, 'html.parser')
+ return self.convert_soup(soup)
+
+ def convert_soup(self, soup):
return self.process_tag(soup, convert_as_inline=False, children_only=True)
def process_tag(self, node, convert_as_inline, children_only=False):
diff --git a/tests/test_custom_converter.py b/tests/test_custom_converter.py
index c7944ab..a3e33ac 100644
--- a/tests/test_custom_converter.py
+++ b/tests/test_custom_converter.py
@@ -1,4 +1,5 @@
from markdownify import MarkdownConverter
+from bs4 import BeautifulSoup
class ImageBlockConverter(MarkdownConverter):
@@ -16,3 +17,9 @@ def test_img():
assert md('
') == '\n\n'
assert md('
') == '\n\n'
+
+
+def test_soup():
+ html = 'test'
+ soup = BeautifulSoup(html, 'html.parser')
+ assert MarkdownConverter().convert_soup(soup) == '**test**'