def test_hyphenate_ignores_style_blocks(self): self.assertEqual(hyphenate('<style>justify-content: center</style>'), '<style>justify-content: center</style>')
def test_handle_br(self): self.assertEqual(hyphenate('<br>'), '<br>')
def test_hyphenate_ignores_comments(self): self.assertEqual(hyphenate('<!--comment-->'), '<!--comment-->')
def test_dont_hyphenate_square_mathjax_but_hyphenate_the_rest(self): # Add hello, so that the algorithm recognizes the text as English. self.assertEqual( hyphenate('hello \[\ldots\] digitalization').strip(), 'hel­lo \[\ldots\] di­gi­ta­li­za­tion')
def test_dont_hyphenate_sind(self): self.assertEqual(hyphenate(r'Kinder sind dumm.'), 'Kin­der sind dumm.')
def test_hyphenate(self): for (in_file, out_file) in self.inouts: assertHtmlEqual( self, hyphenate(read_file(in_file)), read_file(out_file), '{in_file:s} doesn\'t match {out_file:s}.'.format( in_file=in_file, out_file=out_file))
def test_hyphenate_hyphenates_hyphenation(self): assertHtmlEqual(self, hyphenate('<div>≈ hyphenation</div>'), '<div>≈ hy­phen­ation</div>')
def test_hyphenate_doesnt_add_spurious_whitespace(self): self.assertEqual(hyphenate('<q>word</q>'), '<q>word</q>')