Beispiel #1
0
 def test_invalid_nested_wikilinks_in_ref(self):
     self.assertEqual(
         {
             'Parameter': [],
             'ParserFunction': [],
             'Template': [],
             'WikiLink': [[0, 13]],
             'Comment': [],
             'ExtTag': []
         }, parse_to_spans(bytearray(b'[[L| [[S]] ]]')))
Beispiel #2
0
 def test_single_brace_after_pf_remove(self):
     self.assertEqual(
         {
             'Parameter': [],
             'ParserFunction': [[4, 17]],
             'Template': [[1, 21]],
             'WikiLink': [],
             'Comment': [],
             'ExtTag': []
         }, parse_to_spans(bytearray(b'{{{ {{#if:v|y|n}}} }}')))
Beispiel #3
0
 def test_invalid_nested_wikilinks(self):
     self.assertEqual(
         {
             'Parameter': [],
             'ParserFunction': [],
             'Template': [],
             'WikiLink': [[10, 15]],
             'Comment': [],
             'ExtTag': [[0, 24]]
         }, parse_to_spans(bytearray(b'<ref>[[L| [[S]] ]]</ref>')))
Beispiel #4
0
 def test_nested_wikilinks_in_ref(self):
     self.assertEqual(
         {
             'Parameter': [],
             'ParserFunction': [],
             'Template': [],
             'WikiLink': [[30, 38], [5, 40]],
             'Comment': [],
             'ExtTag': [[0, 46]]
         },
         parse_to_spans(
             bytearray(b'<ref>[[File:Example.jpg|thumb|[[Link]]]]</ref>')))
Beispiel #5
0
 def test_nested_param_semiparser(self):
     self.assertEqual(
         [[1, 14]],
         parse_to_spans(bytearray(b'{{{#if:v|y|n}}}'))['ParserFunction'],
     )
Beispiel #6
0
 def test_parse_inner_contents_of_wikilink_inside_ref(self):
     self.assertEqual(
         [[7, 20]],
         parse_to_spans(
             bytearray(b'<ref>[[{{text|link}}]]</ref>'))['Template'],
     )
Beispiel #7
0
 def test_single_brace_after_first_tl_removal(self):
     self.assertEqual(
         [[7, 16], [0, 20]],
         parse_to_spans(bytearray(b'{{text|{{text|}}} }}'))['Template'],
     )
Beispiel #8
0
 def test_single_brace_in_tl(self):
     self.assertEqual(
         [[0, 12]],
         parse_to_spans(bytearray(b'{{text|i}n}}'))['Template'],
     )