mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.6.3.1'
This commit is contained in:
@@ -133,7 +133,7 @@ public class Xop_xatr_whitelist_mgr {
|
||||
grp_hash.Add_bry_obj(key, itms);
|
||||
}
|
||||
private void Ini_nde(int tag_tid, String... key_strs) {
|
||||
List_adp keys = List_adp_.new_();
|
||||
List_adp keys = List_adp_.New();
|
||||
int len = key_strs.length;
|
||||
for (int i = 0; i < len; i++) {
|
||||
byte[] key = Bry_.new_a7(key_strs[i]);
|
||||
@@ -253,7 +253,7 @@ public class Xop_xatr_whitelist_mgr {
|
||||
.Add_str_byte("image-set" , Style_image_set)
|
||||
.Add_str_byte("/*" , Style_comment)
|
||||
;
|
||||
private static final byte[] Val_role_presentation = Bry_.new_a7("presentation");
|
||||
private static final byte[] Val_role_presentation = Bry_.new_a7("presentation");
|
||||
}
|
||||
class Xop_xatr_whitelist_itm {
|
||||
public Xop_xatr_whitelist_itm(byte[] key, byte key_tid, boolean exact) {this.key = key; this.key_tid = key_tid; this.exact = exact;}
|
||||
|
||||
@@ -27,13 +27,13 @@ public class Xop_xnde_tag {
|
||||
this.xtn_end_tag = Bry_.Add(Xop_xnde_tag_.Bry__end_tag_bgn, name_bry); // always force endtag; needed for <noinclude>
|
||||
this.xtn_end_tag_tmp = new byte[xtn_end_tag.length]; Array_.Copy(xtn_end_tag, xtn_end_tag_tmp);
|
||||
}
|
||||
public int Id() {return id;} private final int id;
|
||||
public byte[] Name_bry() {return name_bry;} private final byte[] name_bry;
|
||||
public String Name_str() {return name_str;} private final String name_str;
|
||||
public int Name_len() {return name_len;} private final int name_len;
|
||||
public byte[] Xtn_bgn_tag() {return xtn_bgn_tag;} private final byte[] xtn_bgn_tag;
|
||||
public byte[] Xtn_end_tag() {return xtn_end_tag;} private final byte[] xtn_end_tag;
|
||||
public byte[] Xtn_end_tag_tmp() {return xtn_end_tag_tmp;} private final byte[] xtn_end_tag_tmp;
|
||||
public int Id() {return id;} private final int id;
|
||||
public byte[] Name_bry() {return name_bry;} private final byte[] name_bry;
|
||||
public String Name_str() {return name_str;} private final String name_str;
|
||||
public int Name_len() {return name_len;} private final int name_len;
|
||||
public byte[] Xtn_bgn_tag() {return xtn_bgn_tag;} private final byte[] xtn_bgn_tag;
|
||||
public byte[] Xtn_end_tag() {return xtn_end_tag;} private final byte[] xtn_end_tag;
|
||||
public byte[] Xtn_end_tag_tmp() {return xtn_end_tag_tmp;} private final byte[] xtn_end_tag_tmp;
|
||||
public boolean Xtn() {return xtn;} public Xop_xnde_tag Xtn_() {xtn = true; return this;} private boolean xtn;
|
||||
public boolean Xtn_mw() {return xtn_mw;} public Xop_xnde_tag Xtn_mw_() {xtn_mw = true; xtn = true; return this;} private boolean xtn_mw; // NOTE: Xtn_mw_() marks both xtn and xtn_mw as true
|
||||
public int Bgn_mode() {return bgn_nde_mode;} private int bgn_nde_mode = Xop_xnde_tag_.Bgn_mode__normal;
|
||||
@@ -64,7 +64,7 @@ public class Xop_xnde_tag {
|
||||
public Xop_xnde_tag Langs_(int lang_code, String name) {
|
||||
if (langs == null) {
|
||||
langs = Ordered_hash_.New();
|
||||
langs_key = Int_obj_ref.neg1_();
|
||||
langs_key = Int_obj_ref.New_neg1();
|
||||
}
|
||||
Xop_xnde_tag_lang lang_tag = new Xop_xnde_tag_lang(lang_code, name);
|
||||
langs.Add(lang_tag.Lang_code(), lang_tag);
|
||||
|
||||
@@ -19,7 +19,7 @@ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.
|
||||
import gplx.core.primitives.*;
|
||||
public class Xop_xnde_tag_lang {
|
||||
public Xop_xnde_tag_lang(int lang_code_int, String name_str) {
|
||||
lang_code = Int_obj_ref.new_(lang_code_int);
|
||||
lang_code = Int_obj_ref.New(lang_code_int);
|
||||
this.name_str = name_str;
|
||||
this.name_bry = Bry_.new_u8(name_str);
|
||||
this.xtnEndTag_tmp = Bry_.Add(Xop_xnde_tag_.Bry__end_tag_bgn, name_bry);
|
||||
@@ -28,5 +28,5 @@ public class Xop_xnde_tag_lang {
|
||||
public String Name_str() {return name_str;} private String name_str;
|
||||
public byte[] Name_bry() {return name_bry;} private byte[] name_bry;
|
||||
public byte[] Xtn_end_tag_tmp() {return xtnEndTag_tmp;} private byte[] xtnEndTag_tmp;
|
||||
public static final Xop_xnde_tag_lang Instance = new Xop_xnde_tag_lang(-1, String_.Empty);
|
||||
public static final Xop_xnde_tag_lang Instance = new Xop_xnde_tag_lang(-1, String_.Empty);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.
|
||||
import gplx.core.btries.*;
|
||||
public class Xop_xnde_tag_regy {
|
||||
private boolean init_needed = true;
|
||||
private final Btrie_slim_mgr // NOTE:ci.utf8; he.s and <section> alias DATE:2014-07-18
|
||||
private final Btrie_slim_mgr // NOTE:ci.utf8; he.s and <section> alias DATE:2014-07-18
|
||||
trie_tmpl = Btrie_slim_mgr.ci_u8()
|
||||
, trie_wtxt_main = Btrie_slim_mgr.ci_u8()
|
||||
, trie_wtxt_tmpl = Btrie_slim_mgr.ci_u8();
|
||||
@@ -29,7 +29,7 @@ public class Xop_xnde_tag_regy {
|
||||
case Xop_parser_.Parse_tid_tmpl: return trie_tmpl;
|
||||
case Xop_parser_.Parse_tid_page_tmpl: return trie_wtxt_tmpl;
|
||||
case Xop_parser_.Parse_tid_page_wiki: return trie_wtxt_main;
|
||||
case Xop_parser_.Parse_tid_null: default: return trie_wtxt_tmpl; // TODO: should throw Err_.new_unhandled(i);
|
||||
case Xop_parser_.Parse_tid_null: default: return trie_wtxt_tmpl; // TODO_OLD: should throw Err_.new_unhandled(i);
|
||||
}
|
||||
}
|
||||
public void Init_by_meta(Hash_adp_bry xtn_hash) {Init_by_hash(xtn_hash);}
|
||||
@@ -59,7 +59,7 @@ public class Xop_xnde_tag_regy {
|
||||
return xtn_hash != null // xtn_hash is null during tests or when wiki is not in site_meta_db
|
||||
&& xnde.Xtn_mw() // only apply filter to xtn_xnde, not basic_xnde; EX: <dynamicpagelist> not <table>
|
||||
&& !xtn_hash.Has(xnde.Name_bry()) // xtn_xnde is not in xtn_hash
|
||||
&& !Int_.In(xnde.Id(), Xop_xnde_tag_.Tid__translate, Xop_xnde_tag_.Tid__languages) // always include <translate> and <languages>; TODO:filter out when extensions supported in site_cfg; DATE:2015-10-13
|
||||
&& !Int_.In(xnde.Id(), Xop_xnde_tag_.Tid__translate, Xop_xnde_tag_.Tid__languages) // always include <translate> and <languages>; TODO_OLD:filter out when extensions supported in site_cfg; DATE:2015-10-13
|
||||
; // skip; xtn is not defined in site_meta_db
|
||||
}
|
||||
private void Add_itm(Btrie_slim_mgr trie, Xop_xnde_tag xnde) {
|
||||
|
||||
@@ -30,6 +30,6 @@ public class Xop_xnde_tag_stack {
|
||||
xmlTags[i] = 0;
|
||||
xmlTagsStack.Clear();
|
||||
}
|
||||
List_adp xmlTagsStack = List_adp_.new_();
|
||||
List_adp xmlTagsStack = List_adp_.New();
|
||||
int[] xmlTags = new int[Xop_xnde_tag_.Tid__len];
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class Xop_xnde_wkr implements Xop_ctx_wkr {
|
||||
++tag_end_pos;
|
||||
break;
|
||||
case Byte_ascii.Dollar: // handles <br$2>;
|
||||
default: // allow all other symbols by defaults; TODO: need to filter out some like <br@>
|
||||
default: // allow all other symbols by defaults; TODO_OLD: need to filter out some like <br@>
|
||||
break;
|
||||
// letters / numbers after tag; tag is invalid; EX: "<spanA"
|
||||
case Byte_ascii.Ltr_A: case Byte_ascii.Ltr_B: case Byte_ascii.Ltr_C: case Byte_ascii.Ltr_D: case Byte_ascii.Ltr_E:
|
||||
|
||||
@@ -19,10 +19,10 @@ package gplx.xowa.parsers.xndes; import gplx.*; import gplx.xowa.*; import gplx.
|
||||
import gplx.core.primitives.*; import gplx.core.btries.*;
|
||||
import gplx.xowa.xtns.pfuncs.strings.*;
|
||||
class Xop_xnde_wkr_ {
|
||||
private static final Btrie_slim_mgr xtn_end_tag_trie = Btrie_slim_mgr.ci_a7(); // NOTE:ci.ascii:MW_const.en; listed XML node names are en
|
||||
private static final Btrie_slim_mgr xtn_end_tag_trie = Btrie_slim_mgr.ci_a7(); // NOTE:ci.ascii:MW_const.en; listed XML node names are en
|
||||
private static final int Find_xtn_end__tid__bgn = 0, Find_xtn_end__tid__end = 1, Find_xtn_end__tid__xtag = 2;
|
||||
private static final Int_obj_ref Find_xtn_end__key__bgn = Int_obj_ref.new_(Find_xtn_end__tid__bgn), Find_xtn_end__key__end = Int_obj_ref.new_(Find_xtn_end__tid__end), Find_xtn_end__key__xtag = Int_obj_ref.new_(Find_xtn_end__tid__xtag);
|
||||
private static final Bry_bfr Find_xtag_end__bfr = Bry_bfr.new_(32);
|
||||
private static final Int_obj_ref Find_xtn_end__key__bgn = Int_obj_ref.New(Find_xtn_end__tid__bgn), Find_xtn_end__key__end = Int_obj_ref.New(Find_xtn_end__tid__end), Find_xtn_end__key__xtag = Int_obj_ref.New(Find_xtn_end__tid__xtag);
|
||||
private static final Bry_bfr Find_xtag_end__bfr = Bry_bfr_.New_w_size(32);
|
||||
public static void AutoClose_handle_dangling_nde_in_caption(Xop_root_tkn root, Xop_tkn_itm owner) {
|
||||
int subs_bgn = -1, subs_len = owner.Subs_len();
|
||||
for (int i = 0; i < subs_len; i++) {
|
||||
|
||||
Reference in New Issue
Block a user