mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.3.4.1'
This commit is contained in:
@@ -121,7 +121,7 @@ public class Arg_bldr {
|
||||
case Xop_tkn_itm_.Tid_xnde:
|
||||
Xop_xnde_tkn sub_as_xnde = (Xop_xnde_tkn)sub;
|
||||
switch (sub_as_xnde.Tag().Id()) {
|
||||
case Xop_xnde_tag_.Tid_noinclude: case Xop_xnde_tag_.Tid_includeonly: case Xop_xnde_tag_.Tid_onlyinclude:
|
||||
case Xop_xnde_tag_.Tid__noinclude: case Xop_xnde_tag_.Tid__includeonly: case Xop_xnde_tag_.Tid__onlyinclude:
|
||||
itm_is_static = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Nowiki_escape_itm {
|
||||
trie_new_itm(rv, Byte_ascii.Apos_bry , Xop_amp_trie.Bry_xowa_apos); // NOTE: for backward compatibility, use ' note that amp_wkr will turn ' -> ' but ' -> '; DATE:2014-07-03
|
||||
trie_new_itm(rv, Byte_ascii.Colon_bry , Xop_amp_trie.Bry_xowa_colon);
|
||||
trie_new_itm(rv, Byte_ascii.Underline_bry , Xop_amp_trie.Bry_xowa_underline);
|
||||
trie_new_itm(rv, Byte_ascii.Asterisk_bry , Xop_amp_trie.Bry_xowa_asterisk);
|
||||
trie_new_itm(rv, Byte_ascii.Star_bry , Xop_amp_trie.Bry_xowa_asterisk);
|
||||
trie_new_itm(rv, Byte_ascii.Dash_bry , Xop_amp_trie.Bry_xowa_dash); // needed to handle "|<nowiki>-</nowiki>"; PAGE:de.w:Liste_von_Vereinen_und_Vereinigungen_von_Gl<47>ubigen_(r<>misch-katholische_Kirche) DATE:2015-01-08
|
||||
trie_new_itm(rv, Byte_ascii.Space_bry , Xop_amp_trie.Bry_xowa_space);
|
||||
trie_new_itm(rv, Byte_ascii.Nl_bry , Xop_amp_trie.Bry_xowa_nl);
|
||||
|
||||
@@ -70,11 +70,9 @@ public class Xop_subst_tst {
|
||||
fxt.Init_defn_add("ds", "<includeonly>{{subst:</includeonly><includeonly>ET|<nowiki>{{subst:ds}}</nowiki>}}</includeonly>");
|
||||
fxt.Test_parse_page_tmpl_str("{{subst:ds}}", ""); // {{subst:ds}} causes stack overflow; {{ds}} does not
|
||||
}
|
||||
|
||||
// NOTE: these are actually not good tests; MW does subst just before save; it doesn't do subst on load; in this case, the tests are testing load (which will noop); they need to test save (which xowa doesn't do)
|
||||
// @Test public void Tmpl_txt_subst() {fxt.Test_parse_tmpl_str_test("{{subst:xo_print|a}}" , "{{test}}" , "a");}
|
||||
// @Test public void Tmpl_txt_subst_prm() {fxt.Test_parse_tmpl_str_test("{{subst:xo_print|{{{1}}}}}" , "{{test|a}}" , "a");}
|
||||
|
||||
//@Test public void Tmpl_txt_safesubst_prm() {fxt.Test_parse_tmpl_str_test("{{{{{|safesubst:}}}ns:Category}}" , "{{test}}" , "Category");}
|
||||
//@Test public void Tmpl_txt_subst_immed() {fxt.Test_parse_tmpl_str_test("{{xo_print{{subst:!}}a}}" , "{{test}}" , "a");}
|
||||
}
|
||||
|
||||
@@ -56,14 +56,14 @@ public class Xot_invk_mock implements Xot_invk {
|
||||
return Args_get_by_key(src, Bry_.To_a7_bry(idx + 1, 1));
|
||||
}
|
||||
public Arg_nde_tkn Args_get_by_key(byte[] src, byte[] key) {return (Arg_nde_tkn)args.Get_by(key);}
|
||||
public static Xot_invk_mock new_(byte defn_tid, byte[] frame_ttl, KeyVal... args) {return new_(defn_tid, 1, frame_ttl, args);}
|
||||
public static Xot_invk_mock new_(byte[] frame_ttl, KeyVal... args) {return new_(Xot_defn_.Tid_null, 1, frame_ttl, args);}
|
||||
public static Xot_invk_mock test_(byte[] frame_ttl, KeyVal... args) {return new_(Xot_defn_.Tid_null, 0, frame_ttl, args);}
|
||||
public static Xot_invk_mock new_(byte defn_tid, int idx_adj, byte[] frame_ttl, KeyVal... args) {
|
||||
public static Xot_invk_mock new_(byte defn_tid, byte[] frame_ttl, Keyval... args) {return new_(defn_tid, 1, frame_ttl, args);}
|
||||
public static Xot_invk_mock new_(byte[] frame_ttl, Keyval... args) {return new_(Xot_defn_.Tid_null, 1, frame_ttl, args);}
|
||||
public static Xot_invk_mock test_(byte[] frame_ttl, Keyval... args) {return new_(Xot_defn_.Tid_null, 0, frame_ttl, args);}
|
||||
public static Xot_invk_mock new_(byte defn_tid, int idx_adj, byte[] frame_ttl, Keyval... args) {
|
||||
Xot_invk_mock rv = new Xot_invk_mock(defn_tid, idx_adj, frame_ttl);
|
||||
int len = args.length;
|
||||
for (int i = 0; i < len; i++) {
|
||||
KeyVal kv = args[i];
|
||||
Keyval kv = args[i];
|
||||
String kv_key_str = kv.Key();
|
||||
Object kv_key_obj = kv.Key_as_obj();
|
||||
Arg_nde_tkn_mock nde_tkn = null;
|
||||
|
||||
@@ -237,9 +237,9 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
rv = true;
|
||||
} catch (Exception e) {
|
||||
if (Env_.Mode_testing())
|
||||
throw Err_.new_exc(e, "xo", "failed to evaluate function", "page", ctx.Page().Ttl().Full_txt(), "defn", defn.Name(), "src", String_.new_u8(src, this.Src_bgn(), this.Src_end()));
|
||||
throw Err_.new_exc(e, "xo", "failed to evaluate function", "page", ctx.Page().Ttl().Full_txt_w_ttl_case(), "defn", defn.Name(), "src", String_.new_u8(src, this.Src_bgn(), this.Src_end()));
|
||||
else {
|
||||
wiki.Appe().Usr_dlg().Warn_many("", "", "failed to evaluate function: page=~{0} defn=~{1} src=~{2} err=~{3}", ctx.Page().Ttl().Full_txt(), defn.Name(), String_.new_u8(src, this.Src_bgn(), this.Src_end()), Err_.Message_gplx_log(e));
|
||||
wiki.Appe().Usr_dlg().Warn_many("", "", "failed to evaluate function: page=~{0} defn=~{1} src=~{2} err=~{3}", ctx.Page().Ttl().Full_txt_w_ttl_case(), defn.Name(), String_.new_u8(src, this.Src_bgn(), this.Src_end()), Err_.Message_gplx_log(e));
|
||||
rv = false;
|
||||
}
|
||||
}
|
||||
@@ -284,7 +284,7 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
break;
|
||||
}
|
||||
return rv;
|
||||
} private static final byte[] Ary_unknown_bgn = Bry_.new_a7("(? [["), Ary_unknown_end = Bry_.new_a7("]] ?)"), Ary_dynamic_is_blank = Bry_.new_a7("dynamic is blank");
|
||||
} private static final byte[] Ary_unknown_bgn = Bry_.new_a7("(? [["), Ary_unknown_end = Bry_.new_a7("]] ?)"), Ary_dynamic_is_blank = Bry_.new_a7("dynamic is blank");
|
||||
private boolean Popup_skip(Xop_ctx ctx, byte[] ttl, Bry_bfr bfr) {
|
||||
boolean skip = false;
|
||||
skip = this.Src_end() - this.Src_bgn() > ctx.Tmpl_tkn_max();
|
||||
@@ -356,7 +356,7 @@ public class Xot_invk_tkn extends Xop_tkn_itm_base implements Xot_invk {
|
||||
return Eval_sub(ctx, transclude_tmpl, caller, src, bfr);
|
||||
}
|
||||
else {
|
||||
Print_not_found(bfr, wiki.Ns_mgr(), page_ttl.Full_txt());
|
||||
Print_not_found(bfr, wiki.Ns_mgr(), page_ttl.Full_txt_w_ttl_case());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class Xot_tmpl_wtr {
|
||||
Xop_xnde_tkn xnde = (Xop_xnde_tkn)tkn;
|
||||
int xnde_tag_id = xnde.Tag().Id();
|
||||
switch (xnde_tag_id) {
|
||||
case Xop_xnde_tag_.Tid_onlyinclude: {
|
||||
case Xop_xnde_tag_.Tid__onlyinclude: {
|
||||
// NOTE: originally "if (ctx.Parse_tid() == Xop_parser_.Parse_tid_page_tmpl) {" but if not needed; Xot_tmpl_wtr should not be called for tmpls and <oi> should not make it to page_wiki
|
||||
Bry_bfr tmp_bfr = Bry_bfr.new_();
|
||||
ctx.Only_include_evaluate_(true);
|
||||
@@ -62,9 +62,9 @@ public class Xot_tmpl_wtr {
|
||||
rslt_bfr.Add_bfr_and_preserve(tmp_bfr);
|
||||
break;
|
||||
}
|
||||
case Xop_xnde_tag_.Tid_includeonly: // noop; DATE:2014-02-12
|
||||
case Xop_xnde_tag_.Tid__includeonly: // noop; DATE:2014-02-12
|
||||
break;
|
||||
case Xop_xnde_tag_.Tid_nowiki: {
|
||||
case Xop_xnde_tag_.Tid__nowiki: {
|
||||
if (xnde.Tag_close_bgn() == Int_.Min_value)
|
||||
rslt_bfr.Add_mid(src, tkn.Src_bgn(), tkn.Src_end()); // write src from bgn/end
|
||||
else { // NOTE: if nowiki then "deactivate" all xndes by swapping out < for < nowiki_xnde_frag; DATE:2013-01-27
|
||||
@@ -76,7 +76,7 @@ public class Xot_tmpl_wtr {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Xop_xnde_tag_.Tid_xowa_cmd:
|
||||
case Xop_xnde_tag_.Tid__xowa_cmd:
|
||||
gplx.xowa.xtns.xowa_cmds.Xop_xowa_cmd xowa_cmd = (gplx.xowa.xtns.xowa_cmds.Xop_xowa_cmd)xnde.Xnde_xtn();
|
||||
rslt_bfr.Add(xowa_cmd.Xtn_html());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user