Ejemplo n.º 1
0
 def test_hyphenate_ignores_style_blocks(self):
     self.assertEqual(hyphenate('<style>justify-content: center</style>'),
                      '<style>justify-content: center</style>')
Ejemplo n.º 2
0
 def test_handle_br(self):
     self.assertEqual(hyphenate('<br>'), '<br>')
Ejemplo n.º 3
0
 def test_hyphenate_ignores_comments(self):
     self.assertEqual(hyphenate('<!--comment-->'), '<!--comment-->')
Ejemplo n.º 4
0
 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&shy;lo \[\ldots\] di&shy;gi&shy;ta&shy;li&shy;za&shy;tion')
Ejemplo n.º 5
0
 def test_dont_hyphenate_sind(self):
     self.assertEqual(hyphenate(r'Kinder sind dumm.'),
                      'Kin&shy;der sind dumm.')
Ejemplo n.º 6
0
 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))
Ejemplo n.º 7
0
 def test_hyphenate_hyphenates_hyphenation(self):
     assertHtmlEqual(self, hyphenate('<div>&asymp; hyphenation</div>'),
                     '<div>&asymp; hy&shy;phen&shy;ation</div>')
Ejemplo n.º 8
0
 def test_hyphenate_doesnt_add_spurious_whitespace(self):
     self.assertEqual(hyphenate('<q>word</q>'), '<q>word</q>')