# Path: chemdataextractor/doc/text.py
# class Paragraph(Text):
# 
#     parsers = [CompoundParser(), ChemicalLabelParser(), NmrParser(), IrParser(), UvvisParser(), MpParser(), TgParser(), ContextParser()]
# 
#     def _repr_html_(self):
#         return '<p class="cde-paragraph">' + self.text + '</p>'
# 
# Path: chemdataextractor/reader/markup.py
# class HtmlReader(LxmlReader):
#     """Reader for generic HTML documents."""
# 
#     def detect(self, fstring, fname=None):
#         """"""
#         if fname and not (fname.endswith('.html') or fname.endswith('.htm')):
#             return False
#         return True
# 
#     def _make_tree(self, fstring):
#         root = etree.fromstring(fstring, parser=HTMLParser(encoding=get_encoding(fstring)))
#         return root


import logging
import unittest
from chemdataextractor.doc import Paragraph
from chemdataextractor.reader import HtmlReader
            self.assertIsInstance(el, Paragraph)

    def test_paragraphs2(self):
        """Test paragraphs are correctly split with no closing element."""
        r = HtmlReader()
        d = r.parse('<p>First para<p>Second Para')
        self.assertEqual(len(d.elements), 2)
        self.assertEqual(d.elements[0].text, 'First para')
        self.assertEqual(d.elements[1].text, 'Second Para')
        for el in d.elements:
            self.assertIsInstance(el, Paragraph)

    def test_linebreak(self):
        """Test br splits paragraph."""
        r = HtmlReader()
        d = r.parse('First line<br/>Second line')
        self.assertEqual(len(d.elements), 2)
        self.assertEqual(d.elements[0].text, 'First line')
        self.assertEqual(d.elements[1].text, 'Second line')
        for el in d.elements:
            self.assertIsInstance(el, Paragraph)

    def test_linebreak2(self):
        """Test br splits paragraph."""
        r = HtmlReader()
        d = r.parse('<span>First line</span><br/><span>Second line</span>')
        self.assertEqual(len(d.elements), 2)
        self.assertEqual(d.elements[0].text, 'First line')
        self.assertEqual(d.elements[1].text, 'Second line')
        for el in d.elements:

# Path: chemdataextractor/doc/text.py
# class Paragraph(Text):
# 
#     parsers = [CompoundParser(), ChemicalLabelParser(), NmrParser(), IrParser(), UvvisParser(), MpParser(), TgParser(), ContextParser()]
# 
#     def _repr_html_(self):
#         return '<p class="cde-paragraph">' + self.text + '</p>'
# 
# Path: chemdataextractor/reader/markup.py
# class HtmlReader(LxmlReader):
#     """Reader for generic HTML documents."""
# 
#     def detect(self, fstring, fname=None):
#         """"""
#         if fname and not (fname.endswith('.html') or fname.endswith('.htm')):
#             return False
#         return True
# 
#     def _make_tree(self, fstring):
#         root = etree.fromstring(fstring, parser=HTMLParser(encoding=get_encoding(fstring)))
#         return root


# Path: tests/test_reader_markup.py
import logging
import unittest
from chemdataextractor.doc import Paragraph
from chemdataextractor.reader import HtmlReader

            self.assertIsInstance(el, Paragraph)

    def test_paragraphs2(self):
        """Test paragraphs are correctly split with no closing element."""
        r = HtmlReader()
        d = r.parse('<p>First para<p>Second Para')
        self.assertEqual(len(d.elements), 2)
        self.assertEqual(d.elements[0].text, 'First para')
        self.assertEqual(d.elements[1].text, 'Second Para')
        for el in d.elements:
            self.assertIsInstance(el, Paragraph)

    def test_linebreak(self):
        """Test br splits paragraph."""
        r = HtmlReader()
        d = r.parse('First line<br/>Second line')
        self.assertEqual(len(d.elements), 2)
        self.assertEqual(d.elements[0].text, 'First line')
        self.assertEqual(d.elements[1].text, 'Second line')
        for el in d.elements:
            self.assertIsInstance(el, Paragraph)

    def test_linebreak2(self):
        """Test br splits paragraph."""
        r = HtmlReader()
        d = r.parse('<span>First line</span><br/><span>Second line</span>')
        self.assertEqual(len(d.elements), 2)
        self.assertEqual(d.elements[0].text, 'First line')
        self.assertEqual(d.elements[1].text, 'Second line')
        for el in d.elements:

            self.assertIsInstance(el, Paragraph)