def test_string_to_numeric_char_reference(self):
        """urlutils - test numeric character conversion from string"""

        self.assertEqual(string_to_numeric_char_reference('abc123'),
                         "abc123")

        self.assertEqual(string_to_numeric_char_reference('\/&;,#$%~é'),
                         "\/&&#59;,#$%~é")
示例#2
0
    def test_string_to_numeric_char_reference(self):
        """urlutils - test numeric character conversion from string"""

        self.assertEqual(string_to_numeric_char_reference('abc123'),
                         "abc123")

        self.assertEqual(string_to_numeric_char_reference('\/&;,#$%~é'),
                         "\/&&#59;,#$%~é")
 def make_verbatim(match_obj):
     """Replace all possible special chars by HTML character
     entities, so that they are not interpreted by further commands"""
     return '<br/><pre class="tex2math_ignore">' + \
            string_to_numeric_char_reference(match_obj.group('content')) + \
            '</pre><br/>'
 def make_verbatim(match_obj):
     """Replace all possible special chars by HTML character
     entities, so that they are not interpreted by further commands"""
     return '<br/><pre class="tex2math_ignore">' + \
            string_to_numeric_char_reference(match_obj.group('content')) + \
            '</pre><br/>'