File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -424,9 +424,23 @@ def process_double_brackets(text, tvar_id=0):
424424 if not (text .startswith ("[[" ) and text .endswith ("]]" )):
425425 print (f"Input >{ text } < must be wrapped in double brackets [[ ]]" )
426426 sys .exit (1 )
427+
428+ if '<tvar' in text :
429+ return text , double_brackets_types .wikilink
427430
428431 inner_wl = text [2 :- 2 ].strip ()
429- parts = inner_wl .split ('|' )
432+ s = inner_wl
433+
434+ first = s .find ('|' )
435+ if first == - 1 :
436+ parts = [s ]
437+ else :
438+ second = s .find ('|' , first + 1 )
439+ if second != - 1 :
440+ parts = [s [:second ], s [second + 1 :]]
441+ else :
442+ parts = [s [:first ], s [first + 1 :]]
443+
430444
431445 category_aliases = ['Category:' , 'category:' , 'Cat:' , 'cat:' ]
432446 file_aliases = ['File:' , 'file:' , 'Image:' , 'image:' ]
@@ -862,3 +876,4 @@ def api_convert():
862876
863877if __name__ == '__main__' :
864878 app .run (debug = True )
879+
You can’t perform that action at this time.
0 commit comments