mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Parser: Change ttl.Page_db() to ttl.Full_db() [#277]
This commit is contained in:
parent
dca2357067
commit
41773e586b
@ -36,7 +36,7 @@ public class Pfunc_displaytitle extends Pf_func_base {
|
||||
byte[] val_html_lc = tmp_bfr.To_bry_and_clear();
|
||||
Xol_case_mgr case_mgr = wiki.Lang().Case_mgr();
|
||||
val_html_lc = Standardize_displaytitle_text(case_mgr, val_html_lc);
|
||||
byte[] page_ttl_lc = Standardize_displaytitle_text(case_mgr, page.Ttl().Page_db());
|
||||
byte[] page_ttl_lc = Standardize_displaytitle_text(case_mgr, page.Ttl().Full_db()); // NOTE: must be .Full_db() to handle non-main ns; PAGE:en.w:Template:Infobox_opera; ISSUE#:277 DATE:2018-11-14;
|
||||
if (!Bry_.Eq(val_html_lc, page_ttl_lc))
|
||||
val_html = null;
|
||||
}
|
||||
|
@ -31,14 +31,20 @@ public class Pfunc_displaytitle_tst {
|
||||
fxt.Test("{{DISPLAYTITLE:<span style='visibility:n;'>A b</span>}}" , expd_fail);
|
||||
fxt.Test("{{DISPLAYTITLE:<span style=''>display:none</span>}}" , null);
|
||||
}
|
||||
@Test public void Ns() {// PURPOSE:fix restrict not working for non-main NS; PAGE:en.w:Template:Infobox_opera; ISSUE#:277 DATE:2018-11-14;
|
||||
fxt .Init_restrict(Bool_.Y)
|
||||
.Init_page_ttl_("Template:A_b")
|
||||
.Test("{{DISPLAYTITLE:Template:<i>A_b</i>}}", "Template:<i>A_b</i>");
|
||||
}
|
||||
}
|
||||
class Pfunc_displaytitle_fxt {
|
||||
private final Xop_fxt fxt = new Xop_fxt();
|
||||
private final Xop_fxt fxt = new Xop_fxt();
|
||||
public void Reset() {
|
||||
fxt.Reset();
|
||||
fxt.Page_ttl_("A b");
|
||||
}
|
||||
public Pfunc_displaytitle_fxt Init_restrict(boolean v) {fxt.Wiki().Cfg_parser().Display_title_restrict_(v); return this;}
|
||||
public Pfunc_displaytitle_fxt Init_page_ttl_(String v) {fxt.Page_ttl_(v); return this;}
|
||||
public void Test(String raw, String expd) {
|
||||
fxt.Page().Html_data().Display_ttl_(null); // TEST: always reset; needed for Strip_display which calls multiple times
|
||||
fxt.Test_parse_tmpl_str_test(raw, "{{test}}", "");
|
||||
|
Loading…
Reference in New Issue
Block a user