mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Table_of_contents: Ignore TOC magic word on transcluded pages
This commit is contained in:
parent
8f1c368ffe
commit
2382c4a535
@ -344,7 +344,7 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
}
|
||||
}
|
||||
if (transclude_src != null) {
|
||||
Xot_defn_tmpl transclude_tmpl = ctx.Wiki().Parser_mgr().Main().Parse_text_to_defn_obj(ctx, ctx.Tkn_mkr(), page_ttl.Ns(), page_ttl.Page_db(), transclude_src);
|
||||
Xot_defn_tmpl transclude_tmpl = ctx.Wiki().Parser_mgr().Main().Parse_text_to_defn_obj(Xop_ctx.New__sub(wiki, ctx, Xoae_page.New(wiki, page_ttl)), ctx.Tkn_mkr(), page_ttl.Ns(), page_ttl.Page_db(), transclude_src);
|
||||
return Eval_sub(ctx, transclude_tmpl, caller, src, bfr);
|
||||
}
|
||||
else {
|
||||
|
@ -48,4 +48,9 @@ public class Xot_invk_wkr__transclude__tst {
|
||||
fxt.Init_defn_add("Test_3", "{{:Template:{{{1}}}}}");
|
||||
fxt.Test_parse_tmpl_str("{{Test 3|b}}", "[[:Template:b]]");
|
||||
}
|
||||
@Test public void Toc() { // PURPOSE: __TOC__ in transcluded page should be ignored; PAGE:de.w:Game_of_Thrones DATE:2016-11-21
|
||||
fxt.Init_page_create("TranscludedToc", "__TOC__\na");
|
||||
fxt.Parser().Expand_tmpl(Bry_.new_u8("{{:TranscludedToc}}"));
|
||||
Tfds.Eq(false, fxt.Page().Wtxt().Toc().Flag__toc()); // transcluded page is true, but current page should still be false
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user