File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1657,6 +1657,11 @@ def int_fn(
16571657 if wtp .project == "wiktionary" and len (args ) > 0 and args [0 ] == "lang" :
16581658 return wtp .lang_code
16591659 if len (args ) > 0 and len (args [0 ]) > 0 :
1660+ page_body = wtp .get_page_body (
1661+ args [0 ], wtp .NAMESPACE_DATA ["MediaWiki" ]["id" ]
1662+ )
1663+ if page_body is not None :
1664+ return page_body
16601665 return f"⧼{ args [0 ]} ⧽"
16611666 return f"[[:{ wtp .LOCAL_NS_NAME_BY_ID .get (10 , '' )} :int:]]"
16621667
Original file line number Diff line number Diff line change @@ -219,3 +219,17 @@ def test_padright_zero_division(self):
219219 self .wtp .start_page ("land" )
220220 self .assertEqual (self .wtp .expand ("{{padright:|1|}}" ), "" )
221221 self .assertEqual (self .wtp .expand ("{{padright:|1}}" ), "0" )
222+
223+ def test_int_mediawiki_page (self ):
224+ # https://vi.wiktionary.org/wiki/Thảo_luận_Mô_đun:ViePron
225+ # https://vi.wiktionary.org/wiki/Bản_mẫu:vie-pron/Bảng
226+ self .wtp .start_page ("test" )
227+ self .wtp .add_page (
228+ "MediaWiki:wiktionary-vie-pron" ,
229+ 8 ,
230+ "[[Wiktionary:IPA|IPA]] theo giọng" ,
231+ )
232+ self .assertEqual (
233+ self .wtp .expand ("{{int:wiktionary-vie-pron}}" ),
234+ "[[Wiktionary:IPA|IPA]] theo giọng" ,
235+ )
You can’t perform that action at this time.
0 commit comments