コード例 #1
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;,#$%~é")
コード例 #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;,#$%~é")
コード例 #3
0
 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/>'
コード例 #4
0
 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/>'