")
, Atr_title = Bry_.new_ascii_(" title=\"")
- , Bry_cls = Bry_.new_ascii_(" class=\"")
- , Bry_cls_thumbborder = Bry_.new_ascii_("thumbborder")
;
}
diff --git a/400_xowa/src/gplx/xowa/html/lnkis/Xoh_file_wtr_basic_tst.java b/400_xowa/src/gplx/xowa/html/lnkis/Xoh_file_wtr_basic_tst.java
index 4bd825ea0..f8f43221d 100644
--- a/400_xowa/src/gplx/xowa/html/lnkis/Xoh_file_wtr_basic_tst.java
+++ b/400_xowa/src/gplx/xowa/html/lnkis/Xoh_file_wtr_basic_tst.java
@@ -111,7 +111,7 @@ public class Xoh_file_wtr_basic_tst {
@Test public void Cls_border_custom() {
fxt.Test_parse_page_wiki_str
( "[[File:A.png|border|class=abc]]"
- , "

");
+ , "

");
}
@Test public void Lnki_full_svg() {
fxt.Test_parse_page_wiki_str
diff --git a/400_xowa/src/gplx/xowa/html/lnkis/Xoh_lnki_consts.java b/400_xowa/src/gplx/xowa/html/lnkis/Xoh_lnki_consts.java
new file mode 100644
index 000000000..6300aaf38
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/html/lnkis/Xoh_lnki_consts.java
@@ -0,0 +1,50 @@
+/*
+XOWA: the XOWA Offline Wiki Application
+Copyright (C) 2012 gnosygnu@gmail.com
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see
.
+*/
+package gplx.xowa.html.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.html.*;
+public class Xoh_lnki_consts {
+ public static final byte
+ Tid_a_cls_none = 0 , Tid_a_cls_image = 1
+ , Tid_a_rel_none = 0 , Tid_a_rel_nofollow = 1
+ , Tid_img_cls_none = 0 , Tid_img_cls_thumbimage = 2, Tid_img_cls_thumbborder = 3
+ ;
+ public static final String Str_img_cls_thumbimage = "thumbimage";
+ private static final byte[]
+ Bry_anchor_class_image = Bry_.new_ascii_(" class=\"image\"")
+ , Bry_anchor_rel_nofollow = Bry_.new_ascii_(" rel=\"nofollow\"")
+ , Bry_img_cls_thumbborder = Bry_.new_ascii_(" class=\"thumbborder\"")
+ , Bry_img_cls_prefix = Bry_.new_ascii_(" class=\"")
+ ;
+ public static final byte[] Bry_img_cls_thumbimage = Bry_.new_ascii_(" class=\"thumbimage\"");
+ public static final byte[] Bry_none = Bry_.Empty;
+ public static byte[] A_cls_to_bry(byte tid) {return tid == Tid_a_cls_none ? Bry_.Empty : Bry_anchor_class_image;}
+ public static byte[] A_rel_to_bry(byte tid) {return tid == Tid_a_rel_none ? Bry_.Empty : Bry_anchor_rel_nofollow;}
+ public static byte[] Img_cls_to_bry(byte tid, byte[] other) {
+ boolean other_is_empty = Bry_.Len_eq_0(other);
+ byte[] rv = null;
+ switch (tid) {
+ case Tid_img_cls_none: return other_is_empty ? Bry_.Empty : Bry_.Add(Bry_img_cls_prefix, other, Byte_ascii.Quote_bry);
+ case Tid_img_cls_thumbimage: rv = Bry_img_cls_thumbimage; break;
+ case Tid_img_cls_thumbborder: rv = Bry_img_cls_thumbborder; break;
+ default: throw Err_.unhandled(tid);
+ }
+ if (other_is_empty) return rv;
+ rv = Bry_.Copy(rv); // copy for replace below
+ rv[rv.length - 1] = Byte_ascii.Space; // replace " with space
+ return Bry_.Add(rv, other, Byte_ascii.Quote_bry); // add custom cls
+ }
+}
diff --git a/400_xowa/src/gplx/xowa/html/lnkis/Xoh_lnki_consts_tst.java b/400_xowa/src/gplx/xowa/html/lnkis/Xoh_lnki_consts_tst.java
new file mode 100644
index 000000000..343d7c275
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/html/lnkis/Xoh_lnki_consts_tst.java
@@ -0,0 +1,34 @@
+/*
+XOWA: the XOWA Offline Wiki Application
+Copyright (C) 2012 gnosygnu@gmail.com
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see
.
+*/
+package gplx.xowa.html.lnkis; import gplx.*; import gplx.xowa.*; import gplx.xowa.html.*;
+import org.junit.*;
+public class Xoh_lnki_consts_tst {
+ private Xoh_lnki_consts_fxt fxt = new Xoh_lnki_consts_fxt();
+ @Test public void Img_cls_to_bry() {
+ fxt.Test_img_cls_to_bry(Xoh_lnki_consts.Tid_img_cls_none , null , "");
+ fxt.Test_img_cls_to_bry(Xoh_lnki_consts.Tid_img_cls_none , "a" , " class=\"a\"");
+ fxt.Test_img_cls_to_bry(Xoh_lnki_consts.Tid_img_cls_thumbimage , null , " class=\"thumbimage\"");
+ fxt.Test_img_cls_to_bry(Xoh_lnki_consts.Tid_img_cls_thumbborder , null , " class=\"thumbborder\"");
+ fxt.Test_img_cls_to_bry(Xoh_lnki_consts.Tid_img_cls_thumbborder , "a" , " class=\"thumbborder a\"");
+ }
+}
+class Xoh_lnki_consts_fxt {
+ public void Test_img_cls_to_bry(byte tid, String other, String expd) {
+ Tfds.Eq(expd, String_.new_utf8_(Xoh_lnki_consts.Img_cls_to_bry(tid, Bry_.new_utf8__null(other))));
+ }
+}
diff --git a/400_xowa/src/gplx/xowa/html/tocs/Xow_toc_mgr.java b/400_xowa/src/gplx/xowa/html/tocs/Xow_toc_mgr.java
index e98541aff..a495f7af2 100644
--- a/400_xowa/src/gplx/xowa/html/tocs/Xow_toc_mgr.java
+++ b/400_xowa/src/gplx/xowa/html/tocs/Xow_toc_mgr.java
@@ -188,6 +188,7 @@ public class Xow_toc_mgr implements Bry_fmtr_arg {
}
public void Html(Xoa_page page, Xoh_wtr_ctx hctx, byte[] src, Bry_bfr bfr) {
if (!page.Hdr_mgr().Toc_enabled()) return; // REF.MW: Parser.php|formatHeadings
+ if (hctx.Mode_is_hdump()) return;
this.page = page;
byte[] bry_contents = page.Wiki().Msg_mgr().Val_by_id(Xol_msg_itm_.Id_toc);
bfmtr_main.Bld_bfr_many(bfr, Bry_fmtr_arg_.bry_(bry_contents), this);
diff --git a/400_xowa/src/gplx/xowa/html/tocs/Xow_toc_mgr_tst.java b/400_xowa/src/gplx/xowa/html/tocs/Xow_toc_mgr_tst.java
index 2023d80a1..5a603212a 100644
--- a/400_xowa/src/gplx/xowa/html/tocs/Xow_toc_mgr_tst.java
+++ b/400_xowa/src/gplx/xowa/html/tocs/Xow_toc_mgr_tst.java
@@ -359,11 +359,11 @@ public class Xow_toc_mgr_tst {
, String_.Concat_lines_nl
( fxt.toc_tbl_nl_n
( "
"
)
- , "
[a]
"
+ , "
[a]
"
));
}
@Test public void Fix_large_before_small() { // PURPOSE.fix: "===a===\n===b===\n" followed by "==c==" causes improper formatting; DATE:2013-05-16
diff --git a/400_xowa/src/gplx/xowa/pages/Xopg_html_data.java b/400_xowa/src/gplx/xowa/pages/Xopg_html_data.java
index fdd35b5e7..64d3e681b 100644
--- a/400_xowa/src/gplx/xowa/pages/Xopg_html_data.java
+++ b/400_xowa/src/gplx/xowa/pages/Xopg_html_data.java
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see
.
*/
package gplx.xowa.pages; import gplx.*; import gplx.xowa.*;
-import gplx.html.*; import gplx.xowa.html.modules.*; import gplx.xowa.pages.skins.*;
+import gplx.html.*; import gplx.xowa.html.modules.*; import gplx.xowa.pages.skins.*; import gplx.xowa.xtns.indicators.*;
public class Xopg_html_data {
private OrderedHash ctg_hash;
public boolean Html_restricted() {return html_restricted;} private boolean html_restricted = true;
@@ -41,6 +41,7 @@ public class Xopg_html_data {
public boolean Lang_convert_content() {return lang_convert_content;} public void Lang_convert_content_(boolean v) {lang_convert_content = v;} private boolean lang_convert_content = true;
public boolean Lang_convert_title() {return lang_convert_title;} public void Lang_convert_title_(boolean v) {lang_convert_title = v;} private boolean lang_convert_title = true;
public Xopg_xtn_skin_mgr Xtn_skin_mgr() {return xtn_skin_mgr;} private Xopg_xtn_skin_mgr xtn_skin_mgr = new Xopg_xtn_skin_mgr();
+ public Indicator_html_bldr Indicators() {return indicators;} public void Indicators_(Indicator_html_bldr v) {indicators = v;} private Indicator_html_bldr indicators;
public int Xtn_gallery_next_id() {return ++xtn_gallery_next_id;} private int xtn_gallery_next_id = -1;
public boolean Xtn_gallery_packed_exists() {return xtn_gallery_packed_exists;} public void Xtn_gallery_packed_exists_y_() {xtn_gallery_packed_exists = true;} private boolean xtn_gallery_packed_exists;
public boolean Xtn_imap_exists() {return xtn_imap_exists;} public void Xtn_imap_exists_y_() {xtn_imap_exists = true;} private boolean xtn_imap_exists;
@@ -78,6 +79,7 @@ public class Xopg_html_data {
module_mgr.Clear();
custom_html = custom_html_end = custom_head_end = custom_name = null;
if (ctg_hash != null) ctg_hash.Clear();
+ indicators = null;
}
public byte[][] Ctgs_to_ary() {return ctg_hash == null ? Bry_.Ary_empty : (byte[][])ctg_hash.Xto_ary(byte[].class);}
public void Ctgs_add(Xoa_ttl ttl) {
diff --git a/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_mgr.java b/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_mgr.java
index c31aa0415..bc0c272f4 100644
--- a/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_mgr.java
+++ b/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_mgr.java
@@ -28,14 +28,17 @@ public class Xop_amp_mgr {
cur_pos = amp_trie.Match_pos();
if (o == null) return null;
Xop_amp_trie_itm itm = (Xop_amp_trie_itm)o;
- if (itm.Tid() == Xop_amp_trie_itm.Tid_name) {
- rslt_pos = cur_pos;
- return tkn_mkr.Amp_txt(amp_pos, cur_pos, itm);
- }
- else {
- boolean ncr_is_hex = itm.Tid() == Xop_amp_trie_itm.Tid_num_hex;
- boolean pass = Parse_as_int(ncr_is_hex, src, src_len, amp_pos, cur_pos);
- return pass ? tkn_mkr.Amp_num(amp_pos, rslt_pos, rslt_val) : null;
+ switch (itm.Tid()) {
+ case Xop_amp_trie_itm.Tid_name_std:
+ case Xop_amp_trie_itm.Tid_name_xowa:
+ rslt_pos = cur_pos;
+ return tkn_mkr.Amp_txt(amp_pos, cur_pos, itm);
+ case Xop_amp_trie_itm.Tid_num_hex:
+ case Xop_amp_trie_itm.Tid_num_dec:
+ boolean ncr_is_hex = itm.Tid() == Xop_amp_trie_itm.Tid_num_hex;
+ boolean pass = Parse_as_int(ncr_is_hex, src, src_len, amp_pos, cur_pos);
+ return pass ? tkn_mkr.Amp_num(amp_pos, rslt_pos, rslt_val) : null;
+ default: throw Err_.unhandled(itm.Tid());
}
}
public byte[] Decode_as_bry(byte[] src) {
@@ -56,18 +59,24 @@ public class Xop_amp_mgr {
dirty = true;
}
Xop_amp_trie_itm amp_itm = (Xop_amp_trie_itm)amp_obj;
- if (amp_itm.Tid() == Xop_amp_trie_itm.Tid_name) {
- tmp_bfr.Add(amp_itm.Utf8_bry());
- pos = amp_trie.Match_pos();
- }
- else {
- boolean ncr_is_hex = amp_itm.Tid() == Xop_amp_trie_itm.Tid_num_hex;
- int int_bgn = amp_trie.Match_pos();
- if (Parse_as_int(ncr_is_hex, src, src_len, pos, int_bgn))
- tmp_bfr.Add_utf8_int(rslt_val);
- else
- tmp_bfr.Add_mid(src, pos, nxt_pos);
- pos = rslt_pos;
+ switch (amp_itm.Tid()) {
+ case Xop_amp_trie_itm.Tid_name_std:
+ case Xop_amp_trie_itm.Tid_name_xowa:
+ tmp_bfr.Add(amp_itm.Utf8_bry());
+ pos = amp_trie.Match_pos();
+ break;
+ case Xop_amp_trie_itm.Tid_num_hex:
+ case Xop_amp_trie_itm.Tid_num_dec:
+ boolean ncr_is_hex = amp_itm.Tid() == Xop_amp_trie_itm.Tid_num_hex;
+ int int_bgn = amp_trie.Match_pos();
+ if (Parse_as_int(ncr_is_hex, src, src_len, pos, int_bgn))
+ tmp_bfr.Add_utf8_int(rslt_val);
+ else
+ tmp_bfr.Add_mid(src, pos, nxt_pos);
+ pos = rslt_pos;
+ break;
+ default:
+ throw Err_.unhandled(amp_itm.Tid());
}
continue;
}
diff --git a/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_tkn_txt.java b/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_tkn_txt.java
index aeae6180c..50f11cdd0 100644
--- a/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_tkn_txt.java
+++ b/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_tkn_txt.java
@@ -22,8 +22,10 @@ public class Xop_amp_tkn_txt extends Xop_tkn_itm_base {
this.html_ref_itm = html_ref_itm;
this.Tkn_ini_pos(false, bgn, end);
}
- @Override public byte Tkn_tid() {return Xop_tkn_itm_.Tid_html_ref;}
- public int Char_int() {return html_ref_itm.Char_int();}
- public byte[] Xml_name_bry() {return html_ref_itm.Xml_name_bry();}
- public void Print_to_html(Bry_bfr bfr) {html_ref_itm.Print_to_html(bfr);}
+ @Override public byte Tkn_tid() {return Xop_tkn_itm_.Tid_html_ref;}
+ public int Char_int() {return html_ref_itm.Char_int();}
+ public byte[] Xml_name_bry() {return html_ref_itm.Xml_name_bry();}
+ public boolean Itm_is_custom() {return html_ref_itm.Tid() == Xop_amp_trie_itm.Tid_name_xowa;}
+ public void Print_ncr(Bry_bfr bfr) {html_ref_itm.Print_ncr(bfr);}
+ public void Print_literal(Bry_bfr bfr) {html_ref_itm.Print_literal(bfr);}
}
diff --git a/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_trie.java b/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_trie.java
index 7d2241368..6456537c7 100644
--- a/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_trie.java
+++ b/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_trie.java
@@ -18,270 +18,293 @@ along with this program. If not, see
.
package gplx.xowa.parsers.amps; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
import gplx.core.btries.*;
public class Xop_amp_trie {
+ public static final byte[] // NOTE: top_define
+ Bry_xowa_lt = Bry_.new_ascii_("&xowa_lt;")
+ , Bry_xowa_brack_bgn = Bry_.new_ascii_("&xowa_brack_bgn;")
+ , Bry_xowa_brack_end = Bry_.new_ascii_("&xowa_brack_end;")
+ , Bry_xowa_pipe = Bry_.new_ascii_("&xowa_pipe;")
+ , Bry_xowa_apos = Bry_.new_ascii_("&xowa_apos;")
+ , Bry_xowa_colon = Bry_.new_ascii_("&xowa_colon;")
+ , Bry_xowa_underline = Bry_.new_ascii_("&xowa_underline;")
+ , Bry_xowa_asterisk = Bry_.new_ascii_("&xowa_asterisk;")
+ , Bry_xowa_space = Bry_.new_ascii_("&xowa_space;")
+ , Bry_xowa_nl = Bry_.new_ascii_("&xowa_nl;")
+ ;
public static final Btrie_slim_mgr _ = new_(); Xop_amp_trie() {}
private static Btrie_slim_mgr new_() {// REF.MW: Sanitizer|$wgHtmlEntities; NOTE:added apos
Btrie_slim_mgr rv = Btrie_slim_mgr.cs_();
- Reg_char(rv, 39, "'");
- Reg_char(rv, 193, "Á");
- Reg_char(rv, 225, "á");
- Reg_char(rv, 194, "Â");
- Reg_char(rv, 226, "â");
- Reg_char(rv, 180, "´");
- Reg_char(rv, 198, "Æ");
- Reg_char(rv, 230, "æ");
- Reg_char(rv, 192, "À");
- Reg_char(rv, 224, "à");
- Reg_char(rv, 8501, "ℵ");
- Reg_char(rv, 913, "Α");
- Reg_char(rv, 945, "α");
- Reg_char(rv, 38, "&");
- Reg_char(rv, 8743, "∧");
- Reg_char(rv, 8736, "∠");
- Reg_char(rv, 197, "Å");
- Reg_char(rv, 229, "å");
- Reg_char(rv, 8776, "≈");
- Reg_char(rv, 195, "Ã");
- Reg_char(rv, 227, "ã");
- Reg_char(rv, 196, "Ä");
- Reg_char(rv, 228, "ä");
- Reg_char(rv, 8222, "„");
- Reg_char(rv, 914, "Β");
- Reg_char(rv, 946, "β");
- Reg_char(rv, 166, "¦");
- Reg_char(rv, 8226, "•");
- Reg_char(rv, 8745, "∩");
- Reg_char(rv, 199, "Ç");
- Reg_char(rv, 231, "ç");
- Reg_char(rv, 184, "¸");
- Reg_char(rv, 162, "¢");
- Reg_char(rv, 935, "Χ");
- Reg_char(rv, 967, "χ");
- Reg_char(rv, 710, "ˆ");
- Reg_char(rv, 9827, "♣");
- Reg_char(rv, 8773, "≅");
- Reg_char(rv, 169, "©");
- Reg_char(rv, 8629, "↵");
- Reg_char(rv, 8746, "∪");
- Reg_char(rv, 164, "¤");
- Reg_char(rv, 8224, "†");
- Reg_char(rv, 8225, "‡");
- Reg_char(rv, 8595, "↓");
- Reg_char(rv, 8659, "⇓");
- Reg_char(rv, 176, "°");
- Reg_char(rv, 916, "Δ");
- Reg_char(rv, 948, "δ");
- Reg_char(rv, 9830, "♦");
- Reg_char(rv, 247, "÷");
- Reg_char(rv, 201, "É");
- Reg_char(rv, 233, "é");
- Reg_char(rv, 202, "Ê");
- Reg_char(rv, 234, "ê");
- Reg_char(rv, 200, "È");
- Reg_char(rv, 232, "è");
- Reg_char(rv, 8709, "∅");
- Reg_char(rv, 8195, " ");
- Reg_char(rv, 8194, " ");
- Reg_char(rv, 917, "Ε");
- Reg_char(rv, 949, "ε");
- Reg_char(rv, 8801, "≡");
- Reg_char(rv, 919, "Η");
- Reg_char(rv, 951, "η");
- Reg_char(rv, 208, "Ð");
- Reg_char(rv, 240, "ð");
- Reg_char(rv, 203, "Ë");
- Reg_char(rv, 235, "ë");
- Reg_char(rv, 8364, "€");
- Reg_char(rv, 8707, "∃");
- Reg_char(rv, 402, "ƒ");
- Reg_char(rv, 8704, "∀");
- Reg_char(rv, 189, "½");
- Reg_char(rv, 188, "¼");
- Reg_char(rv, 190, "¾");
- Reg_char(rv, 8260, "⁄");
- Reg_char(rv, 915, "Γ");
- Reg_char(rv, 947, "γ");
- Reg_char(rv, 8805, "≥");
- Reg_char(rv, 62, ">");
- Reg_char(rv, 8596, "↔");
- Reg_char(rv, 8660, "⇔");
- Reg_char(rv, 9829, "♥");
- Reg_char(rv, 8230, "…");
- Reg_char(rv, 205, "Í");
- Reg_char(rv, 237, "í");
- Reg_char(rv, 206, "Î");
- Reg_char(rv, 238, "î");
- Reg_char(rv, 161, "¡");
- Reg_char(rv, 204, "Ì");
- Reg_char(rv, 236, "ì");
- Reg_char(rv, 8465, "ℑ");
- Reg_char(rv, 8734, "∞");
- Reg_char(rv, 8747, "∫");
- Reg_char(rv, 921, "Ι");
- Reg_char(rv, 953, "ι");
- Reg_char(rv, 191, "¿");
- Reg_char(rv, 8712, "∈");
- Reg_char(rv, 207, "Ï");
- Reg_char(rv, 239, "ï");
- Reg_char(rv, 922, "Κ");
- Reg_char(rv, 954, "κ");
- Reg_char(rv, 923, "Λ");
- Reg_char(rv, 955, "λ");
- Reg_char(rv, 9001, "〈");
- Reg_char(rv, 171, "«");
- Reg_char(rv, 8592, "←");
- Reg_char(rv, 8656, "⇐");
- Reg_char(rv, 8968, "⌈");
- Reg_char(rv, 8220, "“");
- Reg_char(rv, 8804, "≤");
- Reg_char(rv, 8970, "⌊");
- Reg_char(rv, 8727, "∗");
- Reg_char(rv, 9674, "◊");
- Reg_char(rv, 8206, "");
- Reg_char(rv, 8249, "‹");
- Reg_char(rv, 8216, "‘");
- Reg_char(rv, 60, "<");
- Reg_char(rv, 175, "¯");
- Reg_char(rv, 8212, "—");
- Reg_char(rv, 181, "µ");
- Reg_char(rv, 183, "·");
- Reg_char(rv, 8722, "−");
- Reg_char(rv, 924, "Μ");
- Reg_char(rv, 956, "μ");
- Reg_char(rv, 8711, "∇");
- Reg_char(rv, 160, " ");
- Reg_char(rv, 8211, "–");
- Reg_char(rv, 8800, "≠");
- Reg_char(rv, 8715, "∋");
- Reg_char(rv, 172, "¬");
- Reg_char(rv, 8713, "∉");
- Reg_char(rv, 8836, "⊄");
- Reg_char(rv, 209, "Ñ");
- Reg_char(rv, 241, "ñ");
- Reg_char(rv, 925, "Ν");
- Reg_char(rv, 957, "ν");
- Reg_char(rv, 211, "Ó");
- Reg_char(rv, 243, "ó");
- Reg_char(rv, 212, "Ô");
- Reg_char(rv, 244, "ô");
- Reg_char(rv, 338, "Œ");
- Reg_char(rv, 339, "œ");
- Reg_char(rv, 210, "Ò");
- Reg_char(rv, 242, "ò");
- Reg_char(rv, 8254, "‾");
- Reg_char(rv, 937, "Ω");
- Reg_char(rv, 969, "ω");
- Reg_char(rv, 927, "Ο");
- Reg_char(rv, 959, "ο");
- Reg_char(rv, 8853, "⊕");
- Reg_char(rv, 8744, "∨");
- Reg_char(rv, 170, "ª");
- Reg_char(rv, 186, "º");
- Reg_char(rv, 216, "Ø");
- Reg_char(rv, 248, "ø");
- Reg_char(rv, 213, "Õ");
- Reg_char(rv, 245, "õ");
- Reg_char(rv, 8855, "⊗");
- Reg_char(rv, 214, "Ö");
- Reg_char(rv, 246, "ö");
- Reg_char(rv, 182, "¶");
- Reg_char(rv, 8706, "∂");
- Reg_char(rv, 8240, "‰");
- Reg_char(rv, 8869, "⊥");
- Reg_char(rv, 934, "Φ");
- Reg_char(rv, 966, "φ");
- Reg_char(rv, 928, "Π");
- Reg_char(rv, 960, "π");
- Reg_char(rv, 982, "ϖ");
- Reg_char(rv, 177, "±");
- Reg_char(rv, 163, "£");
- Reg_char(rv, 8242, "′");
- Reg_char(rv, 8243, "″");
- Reg_char(rv, 8719, "∏");
- Reg_char(rv, 8733, "∝");
- Reg_char(rv, 936, "Ψ");
- Reg_char(rv, 968, "ψ");
- Reg_char(rv, 34, """);
- Reg_char(rv, 8730, "√");
- Reg_char(rv, 9002, "〉");
- Reg_char(rv, 187, "»");
- Reg_char(rv, 8594, "→");
- Reg_char(rv, 8658, "⇒");
- Reg_char(rv, 8969, "⌉");
- Reg_char(rv, 8221, "”");
- Reg_char(rv, 8476, "ℜ");
- Reg_char(rv, 174, "®");
- Reg_char(rv, 8971, "⌋");
- Reg_char(rv, 929, "Ρ");
- Reg_char(rv, 961, "ρ");
- Reg_char(rv, 8207, "");
- Reg_char(rv, 8250, "›");
- Reg_char(rv, 8217, "’");
- Reg_char(rv, 8218, "‚");
- Reg_char(rv, 352, "Š");
- Reg_char(rv, 353, "š");
- Reg_char(rv, 8901, "⋅");
- Reg_char(rv, 167, "§");
- Reg_char(rv, 173, "");
- Reg_char(rv, 931, "Σ");
- Reg_char(rv, 963, "σ");
- Reg_char(rv, 962, "ς");
- Reg_char(rv, 8764, "∼");
- Reg_char(rv, 9824, "♠");
- Reg_char(rv, 8834, "⊂");
- Reg_char(rv, 8838, "⊆");
- Reg_char(rv, 8721, "∑");
- Reg_char(rv, 8835, "⊃");
- Reg_char(rv, 185, "¹");
- Reg_char(rv, 178, "²");
- Reg_char(rv, 179, "³");
- Reg_char(rv, 8839, "⊇");
- Reg_char(rv, 223, "ß");
- Reg_char(rv, 932, "Τ");
- Reg_char(rv, 964, "τ");
- Reg_char(rv, 8756, "∴");
- Reg_char(rv, 920, "Θ");
- Reg_char(rv, 952, "θ");
- Reg_char(rv, 977, "ϑ");
- Reg_char(rv, 8201, " ");
- Reg_char(rv, 222, "Þ");
- Reg_char(rv, 254, "þ");
- Reg_char(rv, 732, "˜");
- Reg_char(rv, 215, "×");
- Reg_char(rv, 8482, "™");
- Reg_char(rv, 218, "Ú");
- Reg_char(rv, 250, "ú");
- Reg_char(rv, 8593, "↑");
- Reg_char(rv, 8657, "⇑");
- Reg_char(rv, 219, "Û");
- Reg_char(rv, 251, "û");
- Reg_char(rv, 217, "Ù");
- Reg_char(rv, 249, "ù");
- Reg_char(rv, 168, "¨");
- Reg_char(rv, 978, "ϒ");
- Reg_char(rv, 933, "Υ");
- Reg_char(rv, 965, "υ");
- Reg_char(rv, 220, "Ü");
- Reg_char(rv, 252, "ü");
- Reg_char(rv, 8472, "℘");
- Reg_char(rv, 926, "Ξ");
- Reg_char(rv, 958, "ξ");
- Reg_char(rv, 221, "Ý");
- Reg_char(rv, 253, "ý");
- Reg_char(rv, 165, "¥");
- Reg_char(rv, 376, "Ÿ");
- Reg_char(rv, 255, "ÿ");
- Reg_char(rv, 918, "Ζ");
- Reg_char(rv, 950, "ζ");
- Reg_char(rv, 8205, "");
- Reg_char(rv, 8204, "");
+ Reg_name(rv, Bool_.Y, 60, Bry_xowa_lt);
+ Reg_name(rv, Bool_.Y, 91, Bry_xowa_brack_bgn);
+ Reg_name(rv, Bool_.Y, 93, Bry_xowa_brack_end);
+ Reg_name(rv, Bool_.Y, 124, Bry_xowa_pipe);
+ Reg_name(rv, Bool_.Y, 39, Bry_xowa_apos);
+ Reg_name(rv, Bool_.Y, 58, Bry_xowa_colon);
+ Reg_name(rv, Bool_.Y, 95, Bry_xowa_underline);
+ Reg_name(rv, Bool_.Y, 42, Bry_xowa_asterisk);
+ Reg_name(rv, Bool_.Y, 32, Bry_xowa_space);
+ Reg_name(rv, Bool_.Y, 10, Bry_xowa_nl);
+ Reg_name(rv, Bool_.N, 39, "'");
+ Reg_name(rv, Bool_.N, 193, "Á");
+ Reg_name(rv, Bool_.N, 225, "á");
+ Reg_name(rv, Bool_.N, 194, "Â");
+ Reg_name(rv, Bool_.N, 226, "â");
+ Reg_name(rv, Bool_.N, 180, "´");
+ Reg_name(rv, Bool_.N, 198, "Æ");
+ Reg_name(rv, Bool_.N, 230, "æ");
+ Reg_name(rv, Bool_.N, 192, "À");
+ Reg_name(rv, Bool_.N, 224, "à");
+ Reg_name(rv, Bool_.N, 8501, "ℵ");
+ Reg_name(rv, Bool_.N, 913, "Α");
+ Reg_name(rv, Bool_.N, 945, "α");
+ Reg_name(rv, Bool_.N, 38, "&");
+ Reg_name(rv, Bool_.N, 8743, "∧");
+ Reg_name(rv, Bool_.N, 8736, "∠");
+ Reg_name(rv, Bool_.N, 197, "Å");
+ Reg_name(rv, Bool_.N, 229, "å");
+ Reg_name(rv, Bool_.N, 8776, "≈");
+ Reg_name(rv, Bool_.N, 195, "Ã");
+ Reg_name(rv, Bool_.N, 227, "ã");
+ Reg_name(rv, Bool_.N, 196, "Ä");
+ Reg_name(rv, Bool_.N, 228, "ä");
+ Reg_name(rv, Bool_.N, 8222, "„");
+ Reg_name(rv, Bool_.N, 914, "Β");
+ Reg_name(rv, Bool_.N, 946, "β");
+ Reg_name(rv, Bool_.N, 166, "¦");
+ Reg_name(rv, Bool_.N, 8226, "•");
+ Reg_name(rv, Bool_.N, 8745, "∩");
+ Reg_name(rv, Bool_.N, 199, "Ç");
+ Reg_name(rv, Bool_.N, 231, "ç");
+ Reg_name(rv, Bool_.N, 184, "¸");
+ Reg_name(rv, Bool_.N, 162, "¢");
+ Reg_name(rv, Bool_.N, 935, "Χ");
+ Reg_name(rv, Bool_.N, 967, "χ");
+ Reg_name(rv, Bool_.N, 710, "ˆ");
+ Reg_name(rv, Bool_.N, 9827, "♣");
+ Reg_name(rv, Bool_.N, 8773, "≅");
+ Reg_name(rv, Bool_.N, 169, "©");
+ Reg_name(rv, Bool_.N, 8629, "↵");
+ Reg_name(rv, Bool_.N, 8746, "∪");
+ Reg_name(rv, Bool_.N, 164, "¤");
+ Reg_name(rv, Bool_.N, 8224, "†");
+ Reg_name(rv, Bool_.N, 8225, "‡");
+ Reg_name(rv, Bool_.N, 8595, "↓");
+ Reg_name(rv, Bool_.N, 8659, "⇓");
+ Reg_name(rv, Bool_.N, 176, "°");
+ Reg_name(rv, Bool_.N, 916, "Δ");
+ Reg_name(rv, Bool_.N, 948, "δ");
+ Reg_name(rv, Bool_.N, 9830, "♦");
+ Reg_name(rv, Bool_.N, 247, "÷");
+ Reg_name(rv, Bool_.N, 201, "É");
+ Reg_name(rv, Bool_.N, 233, "é");
+ Reg_name(rv, Bool_.N, 202, "Ê");
+ Reg_name(rv, Bool_.N, 234, "ê");
+ Reg_name(rv, Bool_.N, 200, "È");
+ Reg_name(rv, Bool_.N, 232, "è");
+ Reg_name(rv, Bool_.N, 8709, "∅");
+ Reg_name(rv, Bool_.N, 8195, " ");
+ Reg_name(rv, Bool_.N, 8194, " ");
+ Reg_name(rv, Bool_.N, 917, "Ε");
+ Reg_name(rv, Bool_.N, 949, "ε");
+ Reg_name(rv, Bool_.N, 8801, "≡");
+ Reg_name(rv, Bool_.N, 919, "Η");
+ Reg_name(rv, Bool_.N, 951, "η");
+ Reg_name(rv, Bool_.N, 208, "Ð");
+ Reg_name(rv, Bool_.N, 240, "ð");
+ Reg_name(rv, Bool_.N, 203, "Ë");
+ Reg_name(rv, Bool_.N, 235, "ë");
+ Reg_name(rv, Bool_.N, 8364, "€");
+ Reg_name(rv, Bool_.N, 8707, "∃");
+ Reg_name(rv, Bool_.N, 402, "ƒ");
+ Reg_name(rv, Bool_.N, 8704, "∀");
+ Reg_name(rv, Bool_.N, 189, "½");
+ Reg_name(rv, Bool_.N, 188, "¼");
+ Reg_name(rv, Bool_.N, 190, "¾");
+ Reg_name(rv, Bool_.N, 8260, "⁄");
+ Reg_name(rv, Bool_.N, 915, "Γ");
+ Reg_name(rv, Bool_.N, 947, "γ");
+ Reg_name(rv, Bool_.N, 8805, "≥");
+ Reg_name(rv, Bool_.N, 62, ">");
+ Reg_name(rv, Bool_.N, 8596, "↔");
+ Reg_name(rv, Bool_.N, 8660, "⇔");
+ Reg_name(rv, Bool_.N, 9829, "♥");
+ Reg_name(rv, Bool_.N, 8230, "…");
+ Reg_name(rv, Bool_.N, 205, "Í");
+ Reg_name(rv, Bool_.N, 237, "í");
+ Reg_name(rv, Bool_.N, 206, "Î");
+ Reg_name(rv, Bool_.N, 238, "î");
+ Reg_name(rv, Bool_.N, 161, "¡");
+ Reg_name(rv, Bool_.N, 204, "Ì");
+ Reg_name(rv, Bool_.N, 236, "ì");
+ Reg_name(rv, Bool_.N, 8465, "ℑ");
+ Reg_name(rv, Bool_.N, 8734, "∞");
+ Reg_name(rv, Bool_.N, 8747, "∫");
+ Reg_name(rv, Bool_.N, 921, "Ι");
+ Reg_name(rv, Bool_.N, 953, "ι");
+ Reg_name(rv, Bool_.N, 191, "¿");
+ Reg_name(rv, Bool_.N, 8712, "∈");
+ Reg_name(rv, Bool_.N, 207, "Ï");
+ Reg_name(rv, Bool_.N, 239, "ï");
+ Reg_name(rv, Bool_.N, 922, "Κ");
+ Reg_name(rv, Bool_.N, 954, "κ");
+ Reg_name(rv, Bool_.N, 923, "Λ");
+ Reg_name(rv, Bool_.N, 955, "λ");
+ Reg_name(rv, Bool_.N, 9001, "〈");
+ Reg_name(rv, Bool_.N, 171, "«");
+ Reg_name(rv, Bool_.N, 8592, "←");
+ Reg_name(rv, Bool_.N, 8656, "⇐");
+ Reg_name(rv, Bool_.N, 8968, "⌈");
+ Reg_name(rv, Bool_.N, 8220, "“");
+ Reg_name(rv, Bool_.N, 8804, "≤");
+ Reg_name(rv, Bool_.N, 8970, "⌊");
+ Reg_name(rv, Bool_.N, 8727, "∗");
+ Reg_name(rv, Bool_.N, 9674, "◊");
+ Reg_name(rv, Bool_.N, 8206, "");
+ Reg_name(rv, Bool_.N, 8249, "‹");
+ Reg_name(rv, Bool_.N, 8216, "‘");
+ Reg_name(rv, Bool_.N, 60, "<");
+ Reg_name(rv, Bool_.N, 175, "¯");
+ Reg_name(rv, Bool_.N, 8212, "—");
+ Reg_name(rv, Bool_.N, 181, "µ");
+ Reg_name(rv, Bool_.N, 183, "·");
+ Reg_name(rv, Bool_.N, 8722, "−");
+ Reg_name(rv, Bool_.N, 924, "Μ");
+ Reg_name(rv, Bool_.N, 956, "μ");
+ Reg_name(rv, Bool_.N, 8711, "∇");
+ Reg_name(rv, Bool_.N, 160, " ");
+ Reg_name(rv, Bool_.N, 8211, "–");
+ Reg_name(rv, Bool_.N, 8800, "≠");
+ Reg_name(rv, Bool_.N, 8715, "∋");
+ Reg_name(rv, Bool_.N, 172, "¬");
+ Reg_name(rv, Bool_.N, 8713, "∉");
+ Reg_name(rv, Bool_.N, 8836, "⊄");
+ Reg_name(rv, Bool_.N, 209, "Ñ");
+ Reg_name(rv, Bool_.N, 241, "ñ");
+ Reg_name(rv, Bool_.N, 925, "Ν");
+ Reg_name(rv, Bool_.N, 957, "ν");
+ Reg_name(rv, Bool_.N, 211, "Ó");
+ Reg_name(rv, Bool_.N, 243, "ó");
+ Reg_name(rv, Bool_.N, 212, "Ô");
+ Reg_name(rv, Bool_.N, 244, "ô");
+ Reg_name(rv, Bool_.N, 338, "Œ");
+ Reg_name(rv, Bool_.N, 339, "œ");
+ Reg_name(rv, Bool_.N, 210, "Ò");
+ Reg_name(rv, Bool_.N, 242, "ò");
+ Reg_name(rv, Bool_.N, 8254, "‾");
+ Reg_name(rv, Bool_.N, 937, "Ω");
+ Reg_name(rv, Bool_.N, 969, "ω");
+ Reg_name(rv, Bool_.N, 927, "Ο");
+ Reg_name(rv, Bool_.N, 959, "ο");
+ Reg_name(rv, Bool_.N, 8853, "⊕");
+ Reg_name(rv, Bool_.N, 8744, "∨");
+ Reg_name(rv, Bool_.N, 170, "ª");
+ Reg_name(rv, Bool_.N, 186, "º");
+ Reg_name(rv, Bool_.N, 216, "Ø");
+ Reg_name(rv, Bool_.N, 248, "ø");
+ Reg_name(rv, Bool_.N, 213, "Õ");
+ Reg_name(rv, Bool_.N, 245, "õ");
+ Reg_name(rv, Bool_.N, 8855, "⊗");
+ Reg_name(rv, Bool_.N, 214, "Ö");
+ Reg_name(rv, Bool_.N, 246, "ö");
+ Reg_name(rv, Bool_.N, 182, "¶");
+ Reg_name(rv, Bool_.N, 8706, "∂");
+ Reg_name(rv, Bool_.N, 8240, "‰");
+ Reg_name(rv, Bool_.N, 8869, "⊥");
+ Reg_name(rv, Bool_.N, 934, "Φ");
+ Reg_name(rv, Bool_.N, 966, "φ");
+ Reg_name(rv, Bool_.N, 928, "Π");
+ Reg_name(rv, Bool_.N, 960, "π");
+ Reg_name(rv, Bool_.N, 982, "ϖ");
+ Reg_name(rv, Bool_.N, 177, "±");
+ Reg_name(rv, Bool_.N, 163, "£");
+ Reg_name(rv, Bool_.N, 8242, "′");
+ Reg_name(rv, Bool_.N, 8243, "″");
+ Reg_name(rv, Bool_.N, 8719, "∏");
+ Reg_name(rv, Bool_.N, 8733, "∝");
+ Reg_name(rv, Bool_.N, 936, "Ψ");
+ Reg_name(rv, Bool_.N, 968, "ψ");
+ Reg_name(rv, Bool_.N, 34, """);
+ Reg_name(rv, Bool_.N, 8730, "√");
+ Reg_name(rv, Bool_.N, 9002, "〉");
+ Reg_name(rv, Bool_.N, 187, "»");
+ Reg_name(rv, Bool_.N, 8594, "→");
+ Reg_name(rv, Bool_.N, 8658, "⇒");
+ Reg_name(rv, Bool_.N, 8969, "⌉");
+ Reg_name(rv, Bool_.N, 8221, "”");
+ Reg_name(rv, Bool_.N, 8476, "ℜ");
+ Reg_name(rv, Bool_.N, 174, "®");
+ Reg_name(rv, Bool_.N, 8971, "⌋");
+ Reg_name(rv, Bool_.N, 929, "Ρ");
+ Reg_name(rv, Bool_.N, 961, "ρ");
+ Reg_name(rv, Bool_.N, 8207, "");
+ Reg_name(rv, Bool_.N, 8250, "›");
+ Reg_name(rv, Bool_.N, 8217, "’");
+ Reg_name(rv, Bool_.N, 8218, "‚");
+ Reg_name(rv, Bool_.N, 352, "Š");
+ Reg_name(rv, Bool_.N, 353, "š");
+ Reg_name(rv, Bool_.N, 8901, "⋅");
+ Reg_name(rv, Bool_.N, 167, "§");
+ Reg_name(rv, Bool_.N, 173, "");
+ Reg_name(rv, Bool_.N, 931, "Σ");
+ Reg_name(rv, Bool_.N, 963, "σ");
+ Reg_name(rv, Bool_.N, 962, "ς");
+ Reg_name(rv, Bool_.N, 8764, "∼");
+ Reg_name(rv, Bool_.N, 9824, "♠");
+ Reg_name(rv, Bool_.N, 8834, "⊂");
+ Reg_name(rv, Bool_.N, 8838, "⊆");
+ Reg_name(rv, Bool_.N, 8721, "∑");
+ Reg_name(rv, Bool_.N, 8835, "⊃");
+ Reg_name(rv, Bool_.N, 185, "¹");
+ Reg_name(rv, Bool_.N, 178, "²");
+ Reg_name(rv, Bool_.N, 179, "³");
+ Reg_name(rv, Bool_.N, 8839, "⊇");
+ Reg_name(rv, Bool_.N, 223, "ß");
+ Reg_name(rv, Bool_.N, 932, "Τ");
+ Reg_name(rv, Bool_.N, 964, "τ");
+ Reg_name(rv, Bool_.N, 8756, "∴");
+ Reg_name(rv, Bool_.N, 920, "Θ");
+ Reg_name(rv, Bool_.N, 952, "θ");
+ Reg_name(rv, Bool_.N, 977, "ϑ");
+ Reg_name(rv, Bool_.N, 8201, " ");
+ Reg_name(rv, Bool_.N, 222, "Þ");
+ Reg_name(rv, Bool_.N, 254, "þ");
+ Reg_name(rv, Bool_.N, 732, "˜");
+ Reg_name(rv, Bool_.N, 215, "×");
+ Reg_name(rv, Bool_.N, 8482, "™");
+ Reg_name(rv, Bool_.N, 218, "Ú");
+ Reg_name(rv, Bool_.N, 250, "ú");
+ Reg_name(rv, Bool_.N, 8593, "↑");
+ Reg_name(rv, Bool_.N, 8657, "⇑");
+ Reg_name(rv, Bool_.N, 219, "Û");
+ Reg_name(rv, Bool_.N, 251, "û");
+ Reg_name(rv, Bool_.N, 217, "Ù");
+ Reg_name(rv, Bool_.N, 249, "ù");
+ Reg_name(rv, Bool_.N, 168, "¨");
+ Reg_name(rv, Bool_.N, 978, "ϒ");
+ Reg_name(rv, Bool_.N, 933, "Υ");
+ Reg_name(rv, Bool_.N, 965, "υ");
+ Reg_name(rv, Bool_.N, 220, "Ü");
+ Reg_name(rv, Bool_.N, 252, "ü");
+ Reg_name(rv, Bool_.N, 8472, "℘");
+ Reg_name(rv, Bool_.N, 926, "Ξ");
+ Reg_name(rv, Bool_.N, 958, "ξ");
+ Reg_name(rv, Bool_.N, 221, "Ý");
+ Reg_name(rv, Bool_.N, 253, "ý");
+ Reg_name(rv, Bool_.N, 165, "¥");
+ Reg_name(rv, Bool_.N, 376, "Ÿ");
+ Reg_name(rv, Bool_.N, 255, "ÿ");
+ Reg_name(rv, Bool_.N, 918, "Ζ");
+ Reg_name(rv, Bool_.N, 950, "ζ");
+ Reg_name(rv, Bool_.N, 8205, "");
+ Reg_name(rv, Bool_.N, 8204, "");
Reg_prefix(rv, Xop_amp_trie_itm.Tid_num_hex, "#x");
Reg_prefix(rv, Xop_amp_trie_itm.Tid_num_hex, "#X");
Reg_prefix(rv, Xop_amp_trie_itm.Tid_num_dec, "#");
return rv;
}
- private static void Reg_char(Btrie_slim_mgr trie, int char_int, String xml_name_str) {
- byte[] xml_name_bry = Bry_.new_ascii_(xml_name_str);
- Xop_amp_trie_itm itm = new Xop_amp_trie_itm(Xop_amp_trie_itm.Tid_name, char_int, xml_name_bry);
+ private static void Reg_name(Btrie_slim_mgr trie, boolean tid_is_xowa, int char_int, String xml_name_str) {Reg_name(trie, tid_is_xowa, char_int, Bry_.new_ascii_(xml_name_str));}
+ private static void Reg_name(Btrie_slim_mgr trie, boolean tid_is_xowa, int char_int, byte[] xml_name_bry) {
+ byte itm_tid = tid_is_xowa ? Xop_amp_trie_itm.Tid_name_xowa : Xop_amp_trie_itm.Tid_name_std;
+ Xop_amp_trie_itm itm = new Xop_amp_trie_itm(itm_tid, char_int, xml_name_bry);
byte[] key = Bry_.Mid(xml_name_bry, 1, xml_name_bry.length); // ignore & for purpose of trie; EX: "amp;"; NOTE: must keep trailing ";" else "& " will be valid;
trie.Add_obj(key, itm);
}
diff --git a/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_trie_itm.java b/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_trie_itm.java
index 94b26d6b0..a4cb4b656 100644
--- a/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_trie_itm.java
+++ b/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_trie_itm.java
@@ -16,8 +16,8 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see
.
*/
package gplx.xowa.parsers.amps; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
-import gplx.xowa.html.lnkis.*;
-public class Xop_amp_trie_itm {
+import gplx.html.*; import gplx.xowa.html.lnkis.*;
+public class Xop_amp_trie_itm {
public Xop_amp_trie_itm(byte tid, int char_int, byte[] xml_name_bry) {
this.tid = tid;
this.char_int = char_int;
@@ -25,23 +25,34 @@ public class Xop_amp_trie_itm {
this.xml_name_bry = xml_name_bry;
this.key_name_len = xml_name_bry.length - 2; // 2 for & and ;
}
- public byte Tid() {return tid;} private byte tid;
- public int Char_int() {return char_int;} private int char_int; // val; EX: 160
- public byte[] Utf8_bry() {return utf8_bry;} private byte[] utf8_bry; // EX: new byte[] {192, 160}; (C2, A0)
- public byte[] Xml_name_bry() {return xml_name_bry;} private byte[] xml_name_bry; // EX: " "
- public int Key_name_len() {return key_name_len;} private int key_name_len; // EX: "nbsp".Len
- public void Print_to_html(Bry_bfr bfr) { // EX: " "
+ public byte Tid() {return tid;} private final byte tid;
+ public int Char_int() {return char_int;} private final int char_int; // val; EX: 160
+ public byte[] Utf8_bry() {return utf8_bry;} private final byte[] utf8_bry; // EX: new byte[] {192, 160}; (C2, A0)
+ public byte[] Xml_name_bry() {return xml_name_bry;} private final byte[] xml_name_bry; // EX: " "
+ public int Key_name_len() {return key_name_len;} private final int key_name_len; // EX: "nbsp".Len
+ public void Print_ncr(Bry_bfr bfr) {
switch (char_int) {
case Byte_ascii.Lt: case Byte_ascii.Gt: case Byte_ascii.Quote: case Byte_ascii.Amp:
- bfr.Add(xml_name_bry); // NOTE: never write actual char; EX: "<" should be written as "<", not "<"
+ bfr.Add(xml_name_bry); // NOTE: never write actual char; EX: "<" should be written as "<", not "<"
break;
default:
- bfr.Add(Xoh_lnki_title_fmtr.Escape_bgn); //
- bfr.Add_int_variable(char_int); // 160
- bfr.Add_byte(Byte_ascii.Semic); // ;
+ bfr.Add(Xoh_lnki_title_fmtr.Escape_bgn); //
+ bfr.Add_int_variable(char_int); // 160
+ bfr.Add_byte(Byte_ascii.Semic); // ;
break;
}
}
- public static final byte Tid_name = 1, Tid_num_hex = 2, Tid_num_dec = 3;
+ public void Print_literal(Bry_bfr bfr) {
+ switch (char_int) {
+ case Byte_ascii.Lt: bfr.Add(Html_entity_.Lt_bry); break; // NOTE: never write actual char; EX: "<" should be written as "<", not "<"; MW does same; DATE:2014-11-07
+ case Byte_ascii.Gt: bfr.Add(Html_entity_.Gt_bry); break;
+ case Byte_ascii.Quote: bfr.Add(Html_entity_.Quote_bry); break;
+ case Byte_ascii.Amp: bfr.Add(Html_entity_.Amp_bry); break;
+ default:
+ bfr.Add(utf8_bry); // write literal; EX: "[" not "["
+ break;
+ }
+ }
+ public static final byte Tid_name_std = 1, Tid_name_xowa = 2, Tid_num_hex = 3, Tid_num_dec = 4;
public static final int Char_int_null = -1;
}
diff --git a/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_wkr_tst.java b/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_wkr_tst.java
index b040e1b67..63b7aaa65 100644
--- a/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_wkr_tst.java
+++ b/400_xowa/src/gplx/xowa/parsers/amps/Xop_amp_wkr_tst.java
@@ -32,4 +32,10 @@ public class Xop_amp_wkr_tst {
, "

"
);
}
+ @Test public void Ignore_ncr() { // PURPOSE: check that ncr is unescaped; PAGE:de.w:Cross-Site-Scripting; DATE:2014-07-23
+ fxt.Test_parse_page_all_str
+ ( "a
<iframe>
) b"
+ , "a
<iframe>
) b" // < should not become <
+ );
+ }
}
diff --git a/400_xowa/src/gplx/xowa/parsers/apos/Xop_apos_wkr_tst.java b/400_xowa/src/gplx/xowa/parsers/apos/Xop_apos_wkr_tst.java
index 161242f59..33e3ccfbd 100644
--- a/400_xowa/src/gplx/xowa/parsers/apos/Xop_apos_wkr_tst.java
+++ b/400_xowa/src/gplx/xowa/parsers/apos/Xop_apos_wkr_tst.java
@@ -126,7 +126,7 @@ public class Xop_apos_wkr_tst {
fxt.Test_parse_page_all_str("A ''[[b!!]]'' c", "A
b!! c");
}
@Test public void Nowiki() { // PAGE:en.w:Wiki; DATE:2013-05-13
- fxt.Test_parse_page_all_str("
''a''", "''a''");
+ fxt.Test_parse_page_all_str("
''a''", "''a''");
}
@Test public void Lnki_multi_line() { // PURPOSE: handle apos within multi-line lnki caption; DATE:2013-11-10
fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last
diff --git a/400_xowa/src/gplx/xowa/parsers/tmpls/Nowiki_escape_itm.java b/400_xowa/src/gplx/xowa/parsers/tmpls/Nowiki_escape_itm.java
index 70c490802..5714d4815 100644
--- a/400_xowa/src/gplx/xowa/parsers/tmpls/Nowiki_escape_itm.java
+++ b/400_xowa/src/gplx/xowa/parsers/tmpls/Nowiki_escape_itm.java
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see
.
*/
package gplx.xowa.parsers.tmpls; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
-import gplx.core.btries.*; import gplx.html.*;
+import gplx.core.btries.*; import gplx.html.*; import gplx.xowa.parsers.amps.*;
public class Nowiki_escape_itm {
public Nowiki_escape_itm(byte[] src, byte[] trg) {this.src = src; this.trg = trg; this.src_adj = src.length - 1;}
private int src_adj;
@@ -47,19 +47,19 @@ public class Nowiki_escape_itm {
private static final Btrie_slim_mgr trie = trie_new();
private static Btrie_slim_mgr trie_new() {
Btrie_slim_mgr rv = Btrie_slim_mgr.cs_();
- trie_new_itm(rv, Byte_ascii.Lt_bry , Html_entity_.Lt_bry);
- trie_new_itm(rv, Byte_ascii.Brack_bgn_bry , Html_entity_.Brack_bgn_bry);
- trie_new_itm(rv, Byte_ascii.Brack_end_bry , Html_entity_.Brack_end_bry); // PAGE:en.w: Tall_poppy_syndrome DATE:2014-07-23
- trie_new_itm(rv, Byte_ascii.Pipe_bry , Html_entity_.Pipe_bry);
- trie_new_itm(rv, Byte_ascii.Apos_bry , Html_entity_.Apos_key_bry); // NOTE: for backward compatibility, use ' note that amp_wkr will turn ' -> ' but ' -> '; DATE:2014-07-03
- trie_new_itm(rv, Byte_ascii.Colon_bry , Html_entity_.Colon_bry);
- trie_new_itm(rv, Byte_ascii.Underline_bry , Html_entity_.Underline_bry);
- trie_new_itm(rv, Byte_ascii.Asterisk_bry , Html_entity_.Asterisk_bry);
- trie_new_itm(rv, Byte_ascii.Space_bry , Html_entity_.Space_bry);
- trie_new_itm(rv, Byte_ascii.NewLine_bry , Html_entity_.Nl_bry);
+ trie_new_itm(rv, Byte_ascii.Lt_bry , Xop_amp_trie.Bry_xowa_lt);
+ trie_new_itm(rv, Byte_ascii.Brack_bgn_bry , Xop_amp_trie.Bry_xowa_brack_bgn);
+ trie_new_itm(rv, Byte_ascii.Brack_end_bry , Xop_amp_trie.Bry_xowa_brack_end); // PAGE:en.w: Tall_poppy_syndrome DATE:2014-07-23
+ trie_new_itm(rv, Byte_ascii.Pipe_bry , Xop_amp_trie.Bry_xowa_pipe);
+ 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.Space_bry , Xop_amp_trie.Bry_xowa_space);
+ trie_new_itm(rv, Byte_ascii.NewLine_bry , Xop_amp_trie.Bry_xowa_nl);
trie_new_itm(rv, Pre_bry , Pre_bry);
return rv;
- }
+ }
private static void trie_new_itm(Btrie_slim_mgr rv, byte[] src, byte[] trg) {
Nowiki_escape_itm itm = new Nowiki_escape_itm(src, trg);
rv.Add_obj(src, itm);
diff --git a/400_xowa/src/gplx/xowa/wikis/xwikis/Xow_xwiki_mgr.java b/400_xowa/src/gplx/xowa/wikis/xwikis/Xow_xwiki_mgr.java
index bdae936fc..9ba68898f 100644
--- a/400_xowa/src/gplx/xowa/wikis/xwikis/Xow_xwiki_mgr.java
+++ b/400_xowa/src/gplx/xowa/wikis/xwikis/Xow_xwiki_mgr.java
@@ -169,12 +169,17 @@ public class Xow_xwiki_mgr implements GfoInvkAble {
} private static final String GRP_KEY = "xowa.wiki.xwikis";
public void Add_itm(Xow_xwiki_itm itm) {Add_itm(itm, null);}
private void Add_itm(Xow_xwiki_itm xwiki, Xoac_lang_itm lang) {
+ byte[] xwiki_key = xwiki.Key_bry();
if ( !hash.Has(xwiki.Key_bry()) // only register xwiki / lang pair once
&& lang != null) // null lang should not be registered
lang_mgr.Itms_reg(xwiki, lang);
- hash.AddReplace(xwiki.Key_bry(), xwiki);
- list.AddReplace(xwiki.Key_bry(), xwiki);
- }
+ byte[] xwiki_domain = xwiki.Domain();
+ if (!domain_hash.Has(xwiki_domain)) { // domain is new
+ domain_hash.Add(xwiki_domain, xwiki_key);
+ list.AddReplace(xwiki_key, xwiki); // only add to list if domain is new; some wikis like commons will be added multiple times under different aliases (commons, c, commons.wikimedia.org); need to check domain and add only once DATE:2014-11-07
+ }
+ hash.AddReplace(xwiki_key, xwiki);
+ } private final Hash_adp_bry domain_hash = Hash_adp_bry.ci_ascii_();
public void Add_many(byte[] v) {srl.Load_by_bry(v);}
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
if (ctx.Match(k, Invk_count)) return list.Count();
diff --git a/400_xowa/src/gplx/xowa/wikis/xwikis/Xow_xwiki_mgr_tst.java b/400_xowa/src/gplx/xowa/wikis/xwikis/Xow_xwiki_mgr_tst.java
index 407832b2e..ef7ca35c4 100644
--- a/400_xowa/src/gplx/xowa/wikis/xwikis/Xow_xwiki_mgr_tst.java
+++ b/400_xowa/src/gplx/xowa/wikis/xwikis/Xow_xwiki_mgr_tst.java
@@ -38,6 +38,9 @@ public class Xow_xwiki_mgr_tst {
@Test public void Add_bulk_peers_tid() { // PURPOSE:wikt should generate wiki_tid of wiktionary, not wikipedia; PAGE:en.s:Main_Page DATE:2014-09-14
fxt.Init_wikt ().Test_add_bulk_peers("peer", fxt.xwiki_("wikt", "en.wiktionary.org", "http://en.wiktionary.org/wiki/~{0}"));
}
+ @Test public void Multiple_aliases_should_only_add_once() { // PURPOSE.FIX: multiple aliases for same domain should only be added once to Get_at's list; DATE:2014-11-07
+ fxt.Exec_add_bulk("a1|a.org\na2|a.org").Test_len(1);
+ }
}
class Xow_xwiki_mgr_fxt {
Xow_xwiki_mgr xwiki_mgr; Xoa_lang_mgr lang_mgr; String_bldr sb = String_bldr_.new_(); Xoa_app app; Xow_wiki wiki;
@@ -109,6 +112,8 @@ class Xow_xwiki_mgr_fxt {
Tfds.Eq_str_lines(Xto_str(itms), Xto_str(Xto_ary(itms)));
return this;
}
+ public Xow_xwiki_mgr_fxt Exec_add_bulk(String raw) {xwiki_mgr.Add_bulk(Bry_.new_utf8_(raw)); return this;}
+ public Xow_xwiki_mgr_fxt Test_len(int expd) {Tfds.Eq(expd, xwiki_mgr.Len()); return this;}
Xow_xwiki_itm[] Xto_ary(Xow_xwiki_itm[] itms) {
int len = itms.length;
ListAdp rv = ListAdp_.new_();
diff --git a/400_xowa/src/gplx/xowa/xtns/Xow_xtn_mgr.java b/400_xowa/src/gplx/xowa/xtns/Xow_xtn_mgr.java
index 828093bf1..2bab591fe 100644
--- a/400_xowa/src/gplx/xowa/xtns/Xow_xtn_mgr.java
+++ b/400_xowa/src/gplx/xowa/xtns/Xow_xtn_mgr.java
@@ -17,7 +17,8 @@ along with this program. If not, see
.
*/
package gplx.xowa.xtns; import gplx.*; import gplx.xowa.*;
import gplx.core.btries.*;
-import gplx.xowa.xtns.cite.*; import gplx.xowa.xtns.imaps.*; import gplx.xowa.xtns.relatedSites.*; import gplx.xowa.xtns.insiders.*; import gplx.xowa.xtns.proofreadPage.*; import gplx.xowa.xtns.wdatas.*;
+import gplx.xowa.xtns.cite.*; import gplx.xowa.xtns.imaps.*; import gplx.xowa.xtns.relatedSites.*; import gplx.xowa.xtns.proofreadPage.*; import gplx.xowa.xtns.wdatas.*;
+import gplx.xowa.xtns.insiders.*; import gplx.xowa.xtns.indicators.*;
public class Xow_xtn_mgr implements GfoInvkAble {
private OrderedHash regy = OrderedHash_.new_bry_();
public int Count() {return regy.Count();}
@@ -25,6 +26,7 @@ public class Xow_xtn_mgr implements GfoInvkAble {
public Imap_xtn_mgr Xtn_imap() {return xtn_imap;} private Imap_xtn_mgr xtn_imap;
public Sites_xtn_mgr Xtn_sites() {return xtn_sites;} private Sites_xtn_mgr xtn_sites;
public Insider_xtn_mgr Xtn_insider() {return xtn_insider;} private Insider_xtn_mgr xtn_insider;
+ public Indicator_xtn_mgr Xtn_indicator() {return xtn_indicator;} private Indicator_xtn_mgr xtn_indicator;
public Pp_xtn_mgr Xtn_proofread() {return xtn_proofread;} private Pp_xtn_mgr xtn_proofread;
public Wdata_xtn_mgr Xtn_wikibase() {return xtn_wikibase;} private Wdata_xtn_mgr xtn_wikibase;
public Xow_xtn_mgr Ctor_by_app(Xoa_app app) { // NOTE: needed for options
@@ -32,6 +34,7 @@ public class Xow_xtn_mgr implements GfoInvkAble {
Add(app, new Imap_xtn_mgr());
Add(app, new Sites_xtn_mgr());
Add(app, new Insider_xtn_mgr());
+ Add(app, new Indicator_xtn_mgr());
Add(app, new Pp_xtn_mgr());
Add(app, new Wdata_xtn_mgr());
Add(app, new gplx.xowa.xtns.scribunto.Scrib_xtn_mgr());
@@ -87,16 +90,18 @@ public class Xow_xtn_mgr implements GfoInvkAble {
case Tid_cite: xtn_cite = (Cite_xtn_mgr)mgr; break;
case Tid_sites: xtn_sites = (Sites_xtn_mgr)mgr; break;
case Tid_insider: xtn_insider = (Insider_xtn_mgr)mgr; break;
+ case Tid_indicator: xtn_indicator= (Indicator_xtn_mgr)mgr; break;
case Tid_imap: xtn_imap = (Imap_xtn_mgr)mgr; break;
case Tid_proofread: xtn_proofread = (Pp_xtn_mgr)mgr; break;
case Tid_wikibase: xtn_wikibase = (Wdata_xtn_mgr)mgr; break;
}
}
- private static final byte Tid_cite = 0, Tid_sites = 1, Tid_insider = 2, Tid_imap = 3, Tid_proofread = 4, Tid_wikibase = 5;
+ private static final byte Tid_cite = 0, Tid_sites = 1, Tid_insider = 2, Tid_imap = 3, Tid_proofread = 4, Tid_wikibase = 5, Tid_indicator = 6;
private static final Btrie_slim_mgr xtn_tid_trie = Btrie_slim_mgr.cs_()
.Add_bry_bval(Cite_xtn_mgr.XTN_KEY , Tid_cite)
.Add_bry_bval(Sites_xtn_mgr.XTN_KEY , Tid_sites)
.Add_bry_bval(Insider_xtn_mgr.XTN_KEY , Tid_insider)
+ .Add_bry_bval(Indicator_xtn_mgr.XTN_KEY , Tid_indicator)
.Add_bry_bval(Imap_xtn_mgr.XTN_KEY , Tid_imap)
.Add_bry_bval(Pp_xtn_mgr.XTN_KEY , Tid_proofread)
.Add_bry_bval(Wdata_xtn_mgr.XTN_KEY , Tid_wikibase)
diff --git a/400_xowa/src/gplx/xowa/xtns/cite/References_nde.java b/400_xowa/src/gplx/xowa/xtns/cite/References_nde.java
index f4ab4ab07..cb0ffad1c 100644
--- a/400_xowa/src/gplx/xowa/xtns/cite/References_nde.java
+++ b/400_xowa/src/gplx/xowa/xtns/cite/References_nde.java
@@ -50,7 +50,7 @@ public class References_nde implements Xox_xnde, Xop_xnde_atr_parser {
public void Xtn_write(Bry_bfr bfr, Xoa_app app, Xop_ctx ctx, Xoh_html_wtr html_wtr, Xoh_wtr_ctx hctx, Xop_xnde_tkn xnde, byte[] src) {
html_wtr.Ref_wtr().Xnde_references(html_wtr, ctx, hctx, bfr, src, xnde);
}
- public static final byte Xatr_id_group = 0;
+ private static final byte Xatr_id_group = 0;
public static boolean Enabled = true;
private static final Hash_adp_bry xatrs_hash = Hash_adp_bry.ci_ascii_()
.Add_str_obj("group", Byte_obj_val.new_(References_nde.Xatr_id_group));
diff --git a/400_xowa/src/gplx/xowa/xtns/imaps/Imap_map.java b/400_xowa/src/gplx/xowa/xtns/imaps/Imap_map.java
index 3f0da5974..a1f20dad3 100644
--- a/400_xowa/src/gplx/xowa/xtns/imaps/Imap_map.java
+++ b/400_xowa/src/gplx/xowa/xtns/imaps/Imap_map.java
@@ -32,11 +32,15 @@ public class Imap_map implements Xoh_file_img_wkr, Js_img_wkr {
@gplx.Internal protected Imap_itm_desc Desc() {return desc;} private Imap_itm_desc desc;
@gplx.Internal protected Imap_itm_shape[] Shapes() {return shapes;} private Imap_itm_shape[] shapes;
@gplx.Internal protected Imap_err[] Errs() {return errs;} private Imap_err[] errs;
- private byte[] a_href, img_alt, img_cls;
- public void Html_full_img(Bry_bfr tmp_bfr, Xoh_wtr_ctx hctx, Xoa_page page, Xof_xfer_itm xfer_itm, int uid, byte[] a_href, byte[] a_class, byte[] a_rel, byte[] a_title, byte[] a_xowa_title, int img_w, int img_h, byte[] img_src, byte[] img_alt, byte[] img_cls) {
+ private byte img_cls_tid;
+ private byte[] a_href, img_alt, img_cls_other;
+ public void Html_full_img(Bry_bfr tmp_bfr, Xoh_wtr_ctx hctx, Xoa_page page, Xof_xfer_itm xfer_itm, int uid
+ , byte[] a_href, byte a_cls, byte a_rel, byte[] a_title, byte[] a_xowa_title
+ , int img_w, int img_h, byte[] img_src, byte[] img_alt, byte img_cls, byte[] img_cls_other
+ ) {
xfer_itm.Html_img_wkr_(this);
xfer_itm.Html_elem_tid_(Xof_html_elem.Tid_imap);
- this.a_href = a_href; this.img_alt = img_alt; this.img_cls = img_cls;
+ this.a_href = a_href; this.img_alt = img_alt; this.img_cls_tid = img_cls; this.img_cls_other = img_cls_other;
Write_imap_div(tmp_bfr, page, hctx, uid, img_w, img_h, img_src, xfer_itm.Orig_w(), xfer_itm.Orig_h(), xfer_itm.Lnki_ttl());
}
public void Html_update(Xoa_page page, Xog_html_itm html_itm, int html_uid, int html_w, int html_h, String html_src, int orig_w, int orig_h, String orig_src, byte[] lnki_ttl) {
@@ -48,7 +52,7 @@ public class Imap_map implements Xoh_file_img_wkr, Js_img_wkr {
private void Write_imap_div(Bry_bfr bfr, Xoa_page page, Xoh_wtr_ctx hctx, int html_uid, int html_w, int html_h, byte[] html_src, int orig_w, int orig_h, byte[] lnki_ttl) {
byte[] desc_style = Calc_desc_style(html_w, html_h);
map_fmtr_arg.Init(id, shapes, Calc_scale(orig_w, orig_h, html_w, html_h));
- img_fmtr_arg.Init(page, hctx, xtn_mgr, this, html_uid, img_alt, html_src, html_w, html_h, img_cls, a_href, lnki_ttl);
+ img_fmtr_arg.Init(page, hctx, xtn_mgr, this, html_uid, img_alt, html_src, html_w, html_h, Xoh_lnki_consts.Img_cls_to_bry(img_cls_tid, img_cls_other), a_href, lnki_ttl);
Imap_html_fmtrs.All.Bld_bfr_many(bfr, html_uid, desc_style, map_fmtr_arg, img_fmtr_arg);
}
private byte[] Calc_desc_style(int html_w, int html_h) {
diff --git a/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr.java b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr.java
new file mode 100644
index 000000000..805211235
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr.java
@@ -0,0 +1,51 @@
+/*
+XOWA: the XOWA Offline Wiki Application
+Copyright (C) 2012 gnosygnu@gmail.com
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see
.
+*/
+package gplx.xowa.xtns.indicators; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
+public class Indicator_html_bldr implements Bry_fmtr_arg {
+ private Indicator_html_bldr_itm bldr_itm = new Indicator_html_bldr_itm();
+ private ListAdp list = ListAdp_.new_();
+ public void Add(Indicator_xnde xnde) {list.Add(xnde);}
+ public void XferAry(Bry_bfr bfr, int idx) {
+ bldr_itm.Init(list);
+ fmtr_grp.Bld_bfr_many(bfr, bldr_itm);
+ }
+ private static final Bry_fmtr
+ fmtr_grp = Bry_fmtr.new_(String_.Concat_lines_nl_skip_last
+ ( ""
+ , "
~{itms}"
+ , "
"
+ ), "itms")
+ ;
+}
+class Indicator_html_bldr_itm implements Bry_fmtr_arg {
+ private ListAdp list;
+ public void Init(ListAdp list) {this.list = list;}
+ public void XferAry(Bry_bfr bfr, int idx) {
+ int list_len = list.Count();
+ for (int i = 0; i < list_len; ++i) {
+ Indicator_xnde xnde = (Indicator_xnde)list.FetchAt(i);
+ fmtr_itm.Bld_bfr(bfr, xnde.Name(), xnde.Html());
+ }
+ }
+ private static final Bry_fmtr
+ fmtr_itm = Bry_fmtr.new_(String_.Concat_lines_nl_skip_last
+ ( ""
+ , "
~{html}
"
+ ), "name", "html")
+ ;
+}
diff --git a/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr_tst.java b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr_tst.java
new file mode 100644
index 000000000..dfa5ca397
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_html_bldr_tst.java
@@ -0,0 +1,55 @@
+/*
+XOWA: the XOWA Offline Wiki Application
+Copyright (C) 2012 gnosygnu@gmail.com
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see
.
+*/
+package gplx.xowa.xtns.indicators; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
+import org.junit.*; import gplx.xowa.xtns.indicators.*;
+public class Indicator_html_bldr_tst {
+ @Before public void init() {fxt.Clear();} private Indicator_html_bldr_fxt fxt = new Indicator_html_bldr_fxt();
+ @Test public void Basic() {
+ fxt.Init_indicator("a", "b");
+ fxt.Test_bld(String_.Concat_lines_nl_skip_last
+ ( ""
+ , "
"
+ ));
+ }
+}
+class Indicator_html_bldr_fxt {
+ private Xoa_app app; private Xow_wiki wiki; private Xoa_page page;
+ private Indicator_xtn_mgr xtn_mgr;
+ public void Clear() {
+ this.app = Xoa_app_fxt.app_();
+ this.wiki = Xoa_app_fxt.wiki_tst_(app);
+ this.xtn_mgr = wiki.Xtn_mgr().Xtn_indicator();
+ xtn_mgr.Enabled_y_();
+ xtn_mgr.Xtn_init_by_wiki(wiki);
+ this.page = wiki.Ctx().Cur_page();
+ }
+ public void Init_indicator(String name, String html) {
+ Indicator_xnde xnde = new Indicator_xnde();
+ xnde.Init_for_test(Bry_.new_utf8_(name), Bry_.new_utf8_(html));
+ Indicator_html_bldr indicators = new Indicator_html_bldr();
+ indicators.Add(xnde);
+ page.Html_data().Indicators_(indicators);
+ }
+ public void Test_bld(String expd) {
+ Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
+ page.Html_data().Indicators().XferAry(tmp_bfr, 0);
+ Tfds.Eq_str_lines(expd, tmp_bfr.Xto_str_and_clear());
+ }
+}
diff --git a/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xnde.java b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xnde.java
new file mode 100644
index 000000000..7a2bd8c19
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xnde.java
@@ -0,0 +1,46 @@
+/*
+XOWA: the XOWA Offline Wiki Application
+Copyright (C) 2012 gnosygnu@gmail.com
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see
.
+*/
+package gplx.xowa.xtns.indicators; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
+import gplx.xowa.html.*; import gplx.xowa.pages.skins.*;
+public class Indicator_xnde implements Xox_xnde, Xop_xnde_atr_parser {
+ public byte[] Name() {return name;} private byte[] name;
+ public byte[] Html() {return html;} private byte[] html;
+ public void Init_for_test(byte[] name, byte[] html) {this.name = name; this.html = html;} // TEST
+ public void Xatr_parse(Xow_wiki wiki, byte[] src, Xop_xatr_itm xatr, Object xatr_key_obj) {
+ if (xatr_key_obj == null) return;
+ Byte_obj_val xatr_key = (Byte_obj_val)xatr_key_obj;
+ switch (xatr_key.Val()) {
+ case Xatr_name: name = xatr.Val_as_bry(src); break;
+ }
+ }
+ public void Xtn_parse(Xow_wiki wiki, Xop_ctx ctx, Xop_root_tkn root, byte[] src, Xop_xnde_tkn xnde) {
+ Xop_xatr_itm.Xatr_parse(wiki.App(), this, xatrs_hash, wiki, src, xnde);
+ html = wiki.Parser().Parse_text_to_html(ctx, Bry_.Mid(src, xnde.Tag_open_end(), xnde.Tag_close_bgn()));
+ Indicator_html_bldr html_bldr = ctx.Cur_page().Html_data().Indicators();
+ if (html_bldr == null) {
+ html_bldr = new Indicator_html_bldr();
+ ctx.Cur_page().Html_data().Indicators_(html_bldr);
+ }
+ html_bldr.Add(this);
+ }
+ public void Xtn_write(Bry_bfr bfr, Xoa_app app, Xop_ctx ctx, Xoh_html_wtr html_wtr, Xoh_wtr_ctx hctx, Xop_xnde_tkn xnde, byte[] src) {
+ }
+ private static final byte Xatr_name = 0;
+ private static final Hash_adp_bry xatrs_hash = Hash_adp_bry.ci_ascii_()
+ .Add_str_obj("name", Byte_obj_val.new_(Xatr_name));
+}
diff --git a/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xnde_tst.java b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xnde_tst.java
new file mode 100644
index 000000000..d5c21b26a
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xnde_tst.java
@@ -0,0 +1,25 @@
+/*
+XOWA: the XOWA Offline Wiki Application
+Copyright (C) 2012 gnosygnu@gmail.com
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see
.
+*/
+package gplx.xowa.xtns.indicators; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
+import org.junit.*;
+public class Indicator_xnde_tst {
+ @Before public void init() {fxt.Reset();} private Xop_fxt fxt = new Xop_fxt();
+ @Test public void Basic() {
+ fxt.Test_parse_page_all_str("
test", "");
+ }
+}
diff --git a/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xtn_mgr.java b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xtn_mgr.java
new file mode 100644
index 000000000..6bd34002f
--- /dev/null
+++ b/400_xowa/src/gplx/xowa/xtns/indicators/Indicator_xtn_mgr.java
@@ -0,0 +1,26 @@
+/*
+XOWA: the XOWA Offline Wiki Application
+Copyright (C) 2012 gnosygnu@gmail.com
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see
.
+*/
+package gplx.xowa.xtns.indicators; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
+import gplx.html.*; import gplx.xowa.wikis.*;
+public class Indicator_xtn_mgr extends Xox_mgr_base {
+ public Indicator_xtn_mgr() {
+ }
+ @Override public boolean Enabled_default() {return false;}
+ @Override public byte[] Xtn_key() {return XTN_KEY;} public static final byte[] XTN_KEY = Bry_.new_ascii_("Indicator");
+ @Override public Xox_mgr Clone_new() {return new Indicator_xtn_mgr();}
+}
diff --git a/400_xowa/src/gplx/xowa/xtns/pfuncs/pages/Pfunc_displaytitle.java b/400_xowa/src/gplx/xowa/xtns/pfuncs/pages/Pfunc_displaytitle.java
index 16be13399..6c2e03f58 100644
--- a/400_xowa/src/gplx/xowa/xtns/pfuncs/pages/Pfunc_displaytitle.java
+++ b/400_xowa/src/gplx/xowa/xtns/pfuncs/pages/Pfunc_displaytitle.java
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see
.
*/
package gplx.xowa.xtns.pfuncs.pages; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*;
-import gplx.xowa.html.*;
+import gplx.xowa.html.*; import gplx.xowa.langs.cases.*;
public class Pfunc_displaytitle extends Pf_func_base {
@Override public int Id() {return Xol_kwd_grp_.Id_page_displaytitle;}
@Override public Pf_func New(int id, byte[] name) {return new Pfunc_displaytitle().Name_(name);}
@@ -33,15 +33,19 @@ public class Pfunc_displaytitle extends Pf_func_base {
if (restrict) { // restrict only allows displayTitles which have text similar to the pageTitle; PAGE:de.b:Kochbuch/_Druckversion; DATE:2014-08-18
Xoa_page page = ctx.Cur_page();
wiki.Html_mgr().Html_wtr().Write_tkn(tmp_bfr, display_ttl_ctx, Xoh_wtr_ctx.Alt, display_ttl_root.Data_mid(), display_ttl_root, 0, display_ttl_root);
- byte[] val_html_as_text_only = tmp_bfr.Xto_bry_and_clear();
- gplx.xowa.langs.cases.Xol_case_mgr case_mgr = wiki.Lang().Case_mgr();
- val_html_as_text_only = case_mgr.Case_build_lower(val_html_as_text_only);
- byte[] page_ttl_lc = case_mgr.Case_build_lower(page.Ttl().Page_txt());
- if (!Bry_.Eq(val_html_as_text_only, page_ttl_lc))
+ byte[] val_html_lc = tmp_bfr.Xto_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());
+ if (!Bry_.Eq(val_html_lc, page_ttl_lc))
val_html = null;
}
ctx.Cur_page().Html_data().Display_ttl_(val_html);
tmp_bfr.Mkr_rls();
}
+ private static byte[] Standardize_displaytitle_text(Xol_case_mgr case_mgr, byte[] val) {
+ byte[] rv = case_mgr.Case_build_lower(val); // lower-case
+ return Bry_.Replace(rv, Byte_ascii.Space, Byte_ascii.Underline); // force underline; PAGE:de.w:Mod_qos DATE:2014-11-06
+ }
public static final Pfunc_displaytitle _ = new Pfunc_displaytitle(); Pfunc_displaytitle() {}
}
diff --git a/400_xowa/src/gplx/xowa/xtns/pfuncs/pages/Pfunc_displaytitle_tst.java b/400_xowa/src/gplx/xowa/xtns/pfuncs/pages/Pfunc_displaytitle_tst.java
index baebc9a3b..601dca7f2 100644
--- a/400_xowa/src/gplx/xowa/xtns/pfuncs/pages/Pfunc_displaytitle_tst.java
+++ b/400_xowa/src/gplx/xowa/xtns/pfuncs/pages/Pfunc_displaytitle_tst.java
@@ -19,11 +19,12 @@ package gplx.xowa.xtns.pfuncs.pages; import gplx.*; import gplx.xowa.*; import g
import org.junit.*;
public class Pfunc_displaytitle_tst {
@Before public void init() {fxt.Reset();} private Pfunc_displaytitle_fxt fxt = new Pfunc_displaytitle_fxt();
- @Test public void Basic() {fxt.Init_restrict(Bool_.N).Test("{{DISPLAYTITLE:B A}}" , "B A");}
- @Test public void Apos_italic() {fxt.Init_restrict(Bool_.N).Test("{{DISPLAYTITLE:''B A''}}" , "
B A");}
- @Test public void Restrict_skip() {fxt.Init_restrict(Bool_.Y).Test("{{DISPLAYTITLE:B A}}" , null);} // PURPOSE: skip if text does not match title; PAGE:de.b:Kochbuch/_Druckversion; DATE:2014-08-18
- @Test public void Restrict_keep_ci() {fxt.Init_restrict(Bool_.Y).Test("{{DISPLAYTITLE:a B}}" , "a B");} // PURPOSE: keep b/c case-insensitiv match; DATE:2014-08-18
- @Test public void Restrict_keep_tags() {fxt.Init_restrict(Bool_.Y).Test("{{DISPLAYTITLE:
a B}}" , "
a B");}// PURPOSE: keep b/c text match (tags ignored); DATE:2014-08-18
+ @Test public void Basic() {fxt.Init_restrict(Bool_.N).Test("{{DISPLAYTITLE:B A}}" , "B A");}
+ @Test public void Apos_italic() {fxt.Init_restrict(Bool_.N).Test("{{DISPLAYTITLE:''B A''}}" , "
B A");}
+ @Test public void Restrict_skip() {fxt.Init_restrict(Bool_.Y).Test("{{DISPLAYTITLE:B A}}" , null);} // PURPOSE: skip if text does not match title; PAGE:de.b:Kochbuch/_Druckversion; DATE:2014-08-18
+ @Test public void Restrict_keep_ci() {fxt.Init_restrict(Bool_.Y).Test("{{DISPLAYTITLE:a B}}" , "a B");} // PURPOSE: keep b/c case-insensitive match; DATE:2014-08-18
+ @Test public void Restrict_keep_underscore() {fxt.Init_restrict(Bool_.Y).Test("{{DISPLAYTITLE:a_b}}" , "a_b");} // PURPOSE: keep b/c underscores should match spaces; PAGE:de.w:Mod_qos DATE:2014-11-06
+ @Test public void Restrict_keep_tags() {fxt.Init_restrict(Bool_.Y).Test("{{DISPLAYTITLE:
a B}}" , "
a B");}// PURPOSE: keep b/c text match (tags ignored); DATE:2014-08-18
@Test public void Strip_display() {
String expd_fail = "
A b";
fxt.Init_restrict(Bool_.Y);
diff --git a/400_xowa/src/gplx/xowa/xtns/poems/Poem_nde_tst.java b/400_xowa/src/gplx/xowa/xtns/poems/Poem_nde_tst.java
index e67ddc387..b388fb3f1 100644
--- a/400_xowa/src/gplx/xowa/xtns/poems/Poem_nde_tst.java
+++ b/400_xowa/src/gplx/xowa/xtns/poems/Poem_nde_tst.java
@@ -258,11 +258,11 @@ public class Poem_nde_tst {
, "
"
, "a
"
, "b
"
- , "
"
+ , "
"
, "
"
, "c
" // NOTE: "
" not "
"
, "d
"
- , " "
+ , " "
, "
"
, "
"
, ""
diff --git a/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde.java b/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde.java
index 0a79162f1..7f243a857 100644
--- a/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde.java
+++ b/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde.java
@@ -350,7 +350,7 @@ public class Pp_pages_nde implements Xox_xnde, Xop_xnde_atr_parser {
lst_pfunc_wkr.Init_include(ttl.Full_db(), cur_sect_bgn, cur_sect_end).Exec(page_bfr, ctx);
prepend_mgr.End(ctx, full_bfr, page_bfr.Bfr(), page_bfr.Len(), Bool_.Y);
full_bfr.Add_bfr_and_clear(page_bfr);
- full_bfr.Add(gplx.html.Html_entity_.Space_bry);
+ full_bfr.Add(gplx.html.Html_entity_.Space_bry); // $out.= " "; REF.MW:ProofreadPageRenderer.pn
}
page_bfr.Mkr_rls();
ctx.Tmpl_output_(null);
diff --git a/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_basic_tst.java b/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_basic_tst.java
index 8ef12e361..48cd2c616 100644
--- a/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_basic_tst.java
+++ b/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_basic_tst.java
@@ -31,7 +31,7 @@ public class Pp_pages_nde_basic_tst {
@Test public void Basic() {
fxt.Init_page_create("Page:A/1", "abc");
fxt.Test_parse_page_wiki_str("
", String_.Concat_lines_nl
- ( "
abc "
+ ( "
abc "
, "
"
, ""
));
@@ -41,7 +41,7 @@ public class Pp_pages_nde_basic_tst {
fxt.Init_page_create("Page:A/2", "b");
fxt.Init_page_create("Page:A/3", "c");
fxt.Test_parse_page_wiki_str("
", String_.Concat_lines_nl
- ( "
a b c "
+ ( "
a b c "
, "
"
, ""
));
@@ -51,21 +51,21 @@ public class Pp_pages_nde_basic_tst {
fxt.Init_page_create("Page:A/2", "cd");
fxt.Init_page_create("Page:A/3", "e
f");
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "b cd e "
+ ( "
b cd e "
, "
"
));
}
@Test public void Section__onlyinclude() {
fxt.Init_page_create("Page:A/1", "abc");
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "b "
+ ( "
b "
, "
"
));
}
@Test public void Section__onlyinclude_ignores_from_to() {
fxt.Init_page_create("Page:A/1", "abc");
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "b "
+ ( "
b "
, "
"
));
}
@@ -80,7 +80,7 @@ public class Pp_pages_nde_basic_tst {
, " "
, " "
, ""
- , " d f "
+ , " d f "
));
}
@Test public void Err_page_ns_doesnt_exist() {
@@ -92,7 +92,7 @@ public class Pp_pages_nde_basic_tst {
@Test public void Subpage() { // PURPOSE: [[/Page]] should be relative to current page; EX: Flatland and [[/First World]]; DATE:2013-04-29
fxt.Init_page_create("Page:A/1", "[[/Sub1|Sub 1]]");
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "Sub 1 " // NOTE: / is relative to Page_name (in this case Test_page)
+ ( "
Sub 1 " // NOTE: / is relative to Page_name (in this case Test_page)
, "
"
));
}
diff --git a/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_hdr_tst.java b/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_hdr_tst.java
index 15d095abb..8cc7f8509 100644
--- a/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_hdr_tst.java
+++ b/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_hdr_tst.java
@@ -50,7 +50,7 @@ public class Pp_pages_nde_hdr_tst {
fxt.Init_page_create("Page:A/1", "A/1");
// from specified; don't add toc
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "A/1 "
+ ( "
A/1 "
, "
"
));
}
@@ -63,7 +63,7 @@ public class Pp_pages_nde_hdr_tst {
( "value=toc;from=2;to=2;"
, "
"
, ""
- , "a2 "
+ , "
a2 "
, "
"
));
}
diff --git a/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_index_tst.java b/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_index_tst.java
index acca2be1e..f23c2e29e 100644
--- a/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_index_tst.java
+++ b/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_index_tst.java
@@ -39,13 +39,13 @@ public class Pp_pages_nde_index_tst {
, ""
);
fxt.Test_parse_page_wiki_str(main_txt, String_.Concat_lines_nl
- ( "abc "
+ ( "
abc "
, "
"
, "text_0"
- , "d "
+ , "
d "
, "
"
, "text_1"
- , "d "
+ , "
d "
, "
"
));
}
@@ -65,37 +65,37 @@ public class Pp_pages_nde_index_tst {
fxt.Init_page_create("Page:A_b/5", "A_b/5\n");
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
( "A_b/2"
- , " A_b/3"
- , " A_b/4"
- , " "
+ , " A_b/3"
+ , " A_b/4"
+ , " "
, "
"
));
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl // to missing
( "A_b/2"
- , " A_b/3"
- , " A_b/4"
- , " A_b/5"
- , " "
+ , " A_b/3"
+ , " A_b/4"
+ , " A_b/5"
+ , " "
, "
"
));
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl // from missing
( "A_b/1"
- , " A_b/2"
- , " A_b/3"
- , " A_b/4"
- , " "
+ , " A_b/2"
+ , " A_b/3"
+ , " A_b/4"
+ , " "
, "
"
));
}
@Test public void Index_amp_encoded() { // handle ampersand encoded strings; EX: en.s:Team_Work_Wins!; DATE:2014-01-19
fxt.Init_page_create("Index:\"A\"", "[[Page:\"A\"]]");
fxt.Init_page_create("Page:\"A\"", "a");
- fxt.Test_parse_page_wiki_str("", "a \n
");
+ fxt.Test_parse_page_wiki_str("", "a \n
");
}
@Test public void Index_amp_encoded_num() {// handle num-encoded vals; EX: pl.s:Zarządzenie_Nr_11_Ministra_Finansów_z_dnia_21_lipca_2008_r._w_sprawie_ustanowienia_„Dnia_Skarbowości”; DATE:2014-05-07
fxt.Init_page_create("Index:\"A\"", "[[Page:\"A\"]]");
fxt.Init_page_create("Page:\"A\"", "a");
- fxt.Test_parse_page_wiki_str("", "a \n
");
+ fxt.Test_parse_page_wiki_str("", "a \n
");
}
// @Test public void Index_all() { // PURPOSE: if from / to not specified, add all titles
// fxt.Init_page_create("Index:A", String_.Concat_lines_nl
@@ -116,7 +116,7 @@ public class Pp_pages_nde_index_tst {
@Test public void Section_failed_when_xnde() { // PURPOSE: section failed to be retrieved if preceding xnde; DATE:2014-01-15
fxt.Init_page_create("Page:A/1", "ab");
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "b "
+ ( "
b "
, "
"
));
}
@@ -129,8 +129,8 @@ public class Pp_pages_nde_index_tst {
fxt.Init_page_create("Page:A_b/2", "A_b/2\n");
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
( "A_b/1"
- , " A_b/2"
- , " "
+ , " A_b/2"
+ , " "
, "
"
));
}
@@ -145,8 +145,8 @@ public class Pp_pages_nde_index_tst {
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
( "0-1"
, "A/1"
- , " A/2"
- , " "
+ , " A/2"
+ , " "
, "
"
));
}
@@ -156,25 +156,25 @@ public class Pp_pages_nde_index_tst {
fxt.Init_page_create("Page:A/3", "c");
fxt.Init_page_create("Page:A/4", "d");
fxt.Init_page_create("Page:A/5", "e");
- fxt.Test_parse_page_wiki_str("", "a b d \n
\n"); // include
- fxt.Test_parse_page_wiki_str("", "a b d e \n
\n"); // exclude
- fxt.Test_parse_page_wiki_str("", "b c d e \n
\n"); // include should be sorted
- fxt.Test_parse_page_wiki_str("", "a c e \n
\n"); // step
- fxt.Test_parse_page_wiki_str("", "a e \n
\n"); // step
- fxt.Test_parse_page_wiki_str("", "a \n
\n"); // step
- fxt.Test_parse_page_wiki_str("", "c \n
\n"); // from = to
- fxt.Test_parse_page_wiki_str("", " a b c \n
\n"); // from omitted
- fxt.Test_parse_page_wiki_str("", "c d e \n
\n"); // to omitted
- fxt.Test_parse_page_wiki_str("", " a b c \n
\n"); // from is blank
- fxt.Test_parse_page_wiki_str("", "c d e \n
\n"); // to is blank
- fxt.Test_parse_page_wiki_str("", "c d \n
\n"); // allow decimal-like number; PAGE:en.w:Haworth's/Chapter_XIX; DATE:2014-01-19
- fxt.Test_parse_page_wiki_str("", "a b c d e \n
\n"); // exclude is invalid; EX:fr.s:Sanguis_martyrum/Première_partie/I DATE:2014-01-18
- fxt.Test_parse_page_wiki_str("", "a b c d e \n
\n"); // exclude empty; ru.s:ПБЭ/Гуттен,_Ульрих_фон DATE:2014-02-22
+ fxt.Test_parse_page_wiki_str("", "a b d \n
\n"); // include
+ fxt.Test_parse_page_wiki_str("", "a b d e \n
\n"); // exclude
+ fxt.Test_parse_page_wiki_str("", "b c d e \n
\n"); // include should be sorted
+ fxt.Test_parse_page_wiki_str("", "a c e \n
\n"); // step
+ fxt.Test_parse_page_wiki_str("", "a e \n
\n"); // step
+ fxt.Test_parse_page_wiki_str("", "a \n
\n"); // step
+ fxt.Test_parse_page_wiki_str("", "c \n
\n"); // from = to
+ fxt.Test_parse_page_wiki_str("", " a b c \n
\n"); // from omitted
+ fxt.Test_parse_page_wiki_str("", "c d e \n
\n"); // to omitted
+ fxt.Test_parse_page_wiki_str("", " a b c \n
\n"); // from is blank
+ fxt.Test_parse_page_wiki_str("", "c d e \n
\n"); // to is blank
+ fxt.Test_parse_page_wiki_str("", "c d \n
\n"); // allow decimal-like number; PAGE:en.w:Haworth's/Chapter_XIX; DATE:2014-01-19
+ fxt.Test_parse_page_wiki_str("", "a b c d e \n
\n");// exclude is invalid; EX:fr.s:Sanguis_martyrum/Première_partie/I DATE:2014-01-18
+ fxt.Test_parse_page_wiki_str("", "a b c d e \n
\n"); // exclude empty; ru.s:ПБЭ/Гуттен,_Ульрих_фон DATE:2014-02-22
}
@Test public void Ref() { // PURPOSE: ref on page should show; DATE:2014-01-18
fxt.Init_page_create("Page:A/1", "a[b]c");
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "a[1]c "
+ ( "
a[1]c "
, "
"
, ""
, "- ^ b
"
@@ -186,11 +186,11 @@ public class Pp_pages_nde_index_tst {
fxt.Init_page_create("Page:A/2", "* b");
fxt.Init_page_create("Page:A/3", "c");
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "a "
+ ( "
a "
, "
"
, ""
, ""
- , " - b c "
+ , "
- b c "
, "
"
, "
"
, ""
@@ -208,7 +208,7 @@ public class Pp_pages_nde_index_tst {
( "no links"
));
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "A/0 A/1 "
+ ( "
A/0 A/1 "
, "
"
));
@@ -218,7 +218,7 @@ public class Pp_pages_nde_index_tst {
( "[[Page:A/0]]"
));
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "A/0 "
+ ( "
A/0 "
, "
"
));
@@ -229,7 +229,7 @@ public class Pp_pages_nde_index_tst {
, ""
));
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "A/0 A/1 "
+ ( "
A/0 A/1 "
, "
"
));
}
diff --git a/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_recursion_tst.java b/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_recursion_tst.java
index 702123ffa..4eb265b9b 100644
--- a/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_recursion_tst.java
+++ b/400_xowa/src/gplx/xowa/xtns/proofreadPage/Pp_pages_nde_recursion_tst.java
@@ -26,14 +26,14 @@ public class Pp_pages_nde_recursion_tst {
@Test public void Page() { // PURPOSE: handle recursive calls on page; EX: fr.s:Page:NRF_19.djvu/19; DATE:2014-01-01
fxt.Init_page_create("Page:A/1", "abc"); // NOTE: recursive call to self
fxt.Test_parse_page_wiki_str("", String_.Concat_lines_nl
- ( "abc "
+ ( "
abc "
, "
"
, ""
));
}
@Test public void Index() { // PURPOSE: handle recursive calls on index; EX: en.s:Poems_of_Italy:_selections_from_the_Odes_of_Giosue_Carducci/Before_the_Old_Castle_of_Verona; DATE:2014-01-19
fxt.Init_page_create("Index:A", "");
- fxt.Test_parse_page_wiki_str("", " \n
");
+ fxt.Test_parse_page_wiki_str("", " \n
");
}
@Test public void MediaWiki_Proofreadpage_header_template() { // PURPOSE: handle recursive calls through Proofreadpage_header_template; EX: fr.s:L�Enfer_(Barbusse); DATE:2014-05-21
fxt.Init_page_create("MediaWiki:Proofreadpage_header_template", ""); // NOTE: this is just a simulation of fr.s, which calls Module:Header_template which in turn calls preprocess to results in recursion
diff --git a/400_xowa/src/gplx/xowa/xtns/wdatas/Wdata_xwiki_link_wtr_tst.java b/400_xowa/src/gplx/xowa/xtns/wdatas/Wdata_xwiki_link_wtr_tst.java
index dcd660c61..cd5b7f6e0 100644
--- a/400_xowa/src/gplx/xowa/xtns/wdatas/Wdata_xwiki_link_wtr_tst.java
+++ b/400_xowa/src/gplx/xowa/xtns/wdatas/Wdata_xwiki_link_wtr_tst.java
@@ -88,8 +88,8 @@ public class Wdata_xwiki_link_wtr_tst {
, " grp1
"
, " "
, "
"
diff --git a/400_xowa/src_300_html/gplx/xowa/Xop_link_parser.java b/400_xowa/src_300_html/gplx/xowa/Xop_link_parser.java
index c9c340d2b..101c34e87 100644
--- a/400_xowa/src_300_html/gplx/xowa/Xop_link_parser.java
+++ b/400_xowa/src_300_html/gplx/xowa/Xop_link_parser.java
@@ -16,13 +16,13 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see
.
*/
package gplx.xowa; import gplx.*;
-import gplx.xowa.wikis.xwikis.*; import gplx.xowa.html.*; import gplx.xowa.net.*;
+import gplx.xowa.net.*; import gplx.xowa.wikis.xwikis.*; import gplx.xowa.html.*; import gplx.xowa.html.lnkis.*;
public class Xop_link_parser {
public byte[] Html_xowa_ttl() {return html_xowa_ttl;} private byte[] html_xowa_ttl;
- public byte[] Html_anchor_cls() {return html_anchor_cls;} private byte[] html_anchor_cls;
- public byte[] Html_anchor_rel() {return html_anchor_rel;} private byte[] html_anchor_rel;
+ public byte Html_anchor_cls() {return html_anchor_cls;} private byte html_anchor_cls;
+ public byte Html_anchor_rel() {return html_anchor_rel;} private byte html_anchor_rel;
public byte[] Parse(Bry_bfr tmp_bfr, Xoa_url tmp_url, Xow_wiki wiki, byte[] raw, byte[] or) {
- html_xowa_ttl = null; html_anchor_cls = Xow_html_mgr.Bry_anchor_class_image; html_anchor_rel = Xow_html_mgr.Bry_anchor_rel_blank; // default member variables for html
+ html_xowa_ttl = null; html_anchor_cls = Xoh_lnki_consts.Tid_a_cls_image; html_anchor_rel = Xoh_lnki_consts.Tid_a_rel_none; // default member variables for html
Xoa_app app = wiki.App(); int raw_len = raw.length;
app.Url_parser().Parse(tmp_url, raw);
switch (tmp_url.Protocol_tid()) {
@@ -40,8 +40,8 @@ public class Xop_link_parser {
tmp_bfr.Add(raw); // dump everything
}
raw = tmp_bfr.Xto_bry_and_clear();
- html_anchor_cls = Xow_html_mgr.Bry_anchor_class_blank;
- html_anchor_rel = Xow_html_mgr.Bry_anchor_rel_nofollow;
+ html_anchor_cls = Xoh_lnki_consts.Tid_a_cls_none;
+ html_anchor_rel = Xoh_lnki_consts.Tid_a_rel_nofollow;
break;
case Xoo_protocol_itm.Tid_file: // "file:///" or "File:A.png"
int proto_len = tmp_url.Protocol_bry().length;
diff --git a/400_xowa/src_400_parser/gplx/xowa/Xoa_ttl.java b/400_xowa/src_400_parser/gplx/xowa/Xoa_ttl.java
index 01e5ead06..efedd31fe 100644
--- a/400_xowa/src_400_parser/gplx/xowa/Xoa_ttl.java
+++ b/400_xowa/src_400_parser/gplx/xowa/Xoa_ttl.java
@@ -210,7 +210,7 @@ public class Xoa_ttl { // PAGE:en.w:http://en.wikipedia.org/wiki/Help:Link; REF.
if (html_ent_obj != null) {
Xop_amp_trie_itm amp_itm = (Xop_amp_trie_itm)html_ent_obj;
match_pos = amp_trie.Match_pos();
- if (amp_itm.Tid() == Xop_amp_trie_itm.Tid_name) {
+ if (amp_itm.Tid() == Xop_amp_trie_itm.Tid_name_std) {
switch (amp_itm.Char_int()) {
case 160: // NOTE:   must convert to space; EX:w:United States [[Image:Dust Bowl - Dallas, South Dakota 1936.jpg|220px|alt=]]
if (ltr_bgn != -1) add_ws = true; // apply same ws rules as Space, NewLine; needed for converting multiple ws into one; EX:" " -> " " x> " "; PAGEen.w:Greek_government-debt_crisis; DATE:2014-09-25
diff --git a/400_xowa/src_400_parser/gplx/xowa/Xop_sanitizer.java b/400_xowa/src_400_parser/gplx/xowa/Xop_sanitizer.java
index 0ff6587d8..50568d2ef 100644
--- a/400_xowa/src_400_parser/gplx/xowa/Xop_sanitizer.java
+++ b/400_xowa/src_400_parser/gplx/xowa/Xop_sanitizer.java
@@ -74,7 +74,8 @@ public class Xop_sanitizer {
Xop_amp_trie_itm itm = (Xop_amp_trie_itm)amp_obj;
byte itm_tid = itm.Tid();
switch (itm_tid) {
- case Xop_amp_trie_itm.Tid_name:
+ case Xop_amp_trie_itm.Tid_name_std:
+ case Xop_amp_trie_itm.Tid_name_xowa:
bfr.Add(itm.Utf8_bry());
pos += itm.Key_name_len() + 1; // 1 for trailing ";"; EX: for " ", (a) pos is at "&", (b) "nbsp" is Key_name_len, (c) ";" needs + 1
break;
diff --git a/400_xowa/src_405_tkn/gplx/xowa/Xop_tkn_mkr.java b/400_xowa/src_405_tkn/gplx/xowa/Xop_tkn_mkr.java
index 9bb4b651d..50568f6ac 100644
--- a/400_xowa/src_405_tkn/gplx/xowa/Xop_tkn_mkr.java
+++ b/400_xowa/src_405_tkn/gplx/xowa/Xop_tkn_mkr.java
@@ -81,6 +81,7 @@ public class Xop_tkn_mkr {
public gplx.xowa.xtns.templateData.Xtn_templateData_nde Xnde_templateData() {return new gplx.xowa.xtns.templateData.Xtn_templateData_nde();}
public gplx.xowa.xtns.rss.Rss_xnde Xnde_rss() {return new gplx.xowa.xtns.rss.Rss_xnde();}
public gplx.xowa.xtns.quiz.Quiz_xnde Xnde_quiz() {return new gplx.xowa.xtns.quiz.Quiz_xnde();}
+ public gplx.xowa.xtns.indicators.Indicator_xnde Xnde_indicator() {return new gplx.xowa.xtns.indicators.Indicator_xnde();}
public gplx.xowa.xtns.xowa_cmds.Xox_xowa_html_cmd Xnde_xowa_html() {return new gplx.xowa.xtns.xowa_cmds.Xox_xowa_html_cmd();}
public gplx.xowa.xtns.listings.Listing_xnde Xnde_listing(int tag_id) {return new gplx.xowa.xtns.listings.Listing_xnde(tag_id);}
public gplx.xowa.xtns.scores.Score_xnde Xnde_score() {return new gplx.xowa.xtns.scores.Score_xnde();}
diff --git a/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_tag_.java b/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_tag_.java
index 8f0bcfa00..8399f93c8 100644
--- a/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_tag_.java
+++ b/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_tag_.java
@@ -134,8 +134,9 @@ public class Xop_xnde_tag_ {
, Tid_xowa_tag_bgn = 109
, Tid_xowa_tag_end = 110
, Tid_quiz = 111
+, Tid_indicator = 112
;
- public static final int _MaxLen = 112;
+ public static final int _MaxLen = 113;
public static final Xop_xnde_tag[] Ary = new Xop_xnde_tag[_MaxLen];
private static Xop_xnde_tag new_(int id, String name) {
Xop_xnde_tag rv = new Xop_xnde_tag(id, name);
@@ -196,7 +197,7 @@ public class Xop_xnde_tag_ {
, Tag_colgroup = new_(Tid_colgroup, "colgroup")
, Tag_col = new_(Tid_col, "col")
, Tag_a = new_(Tid_a, "a").Restricted_()
-, Tag_img = new_(Tid_img, "img").Xtn_().Restricted_()
+, Tag_img = new_(Tid_img, "img").Restricted_() // NOTE: was .Xtn() DATE:2014-11-06
, Tag_ruby = new_(Tid_ruby, "ruby").NoInline_()
, Tag_rt = new_(Tid_rt, "rt").NoInline_()
, Tag_rb = new_(Tid_rb, "rb").NoInline_()
@@ -255,5 +256,6 @@ public class Xop_xnde_tag_ {
, Tag_xowa_tag_bgn = new_(Tid_xowa_tag_bgn, "xtag_bgn").Xtn_()
, Tag_xowa_tag_end = new_(Tid_xowa_tag_end, "xtag_end").Xtn_()
, Tag_quiz = new_(Tid_quiz, "quiz").Xtn_()
+, Tag_indicator = new_(Tid_indicator, "indicator").Xtn_()
;
}
diff --git a/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_wkr.java b/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_wkr.java
index af0a5aa3f..26a446488 100644
--- a/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_wkr.java
+++ b/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_wkr.java
@@ -654,6 +654,7 @@ public class Xop_xnde_wkr implements Xop_ctx_wkr {
case Xop_xnde_tag_.Tid_templateData: xnde_xtn = tkn_mkr.Xnde_templateData(); break;
case Xop_xnde_tag_.Tid_rss: xnde_xtn = tkn_mkr.Xnde_rss(); break;
case Xop_xnde_tag_.Tid_quiz: xnde_xtn = tkn_mkr.Xnde_quiz(); break;
+ case Xop_xnde_tag_.Tid_indicator: xnde_xtn = tkn_mkr.Xnde_indicator(); break;
case Xop_xnde_tag_.Tid_xowa_html: xnde_xtn = tkn_mkr.Xnde_xowa_html(); break;
case Xop_xnde_tag_.Tid_listing_buy:
case Xop_xnde_tag_.Tid_listing_do:
diff --git a/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_wkr__err_misc_tst.java b/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_wkr__err_misc_tst.java
index c2f52af59..f953a9c33 100644
--- a/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_wkr__err_misc_tst.java
+++ b/400_xowa/src_490_xnde/gplx/xowa/Xop_xnde_wkr__err_misc_tst.java
@@ -184,4 +184,7 @@ public class Xop_xnde_wkr__err_misc_tst {
@Test public void Anchor_nested() {
fxt.Test_parse_page_all_str("b
cd [[e]] f", "b<a>c<a>d e f");
}
+ @Test public void Img_should_not_be_xtn() { // PURPOSE:
![]()
marked as .xtn; unclosed
![]()
was escaping rest of text; PAGE:de.w:Wikipedia:Technik/Archiv/2014 DATE:2014-11-06
+ fxt.Test_parse_page_all_str("
![]()
''a''", "<img>
a");
+ }
}
diff --git a/tst/400_xowa/root/file/en.wikipedia.org/fsdb.user/fsdb.atr.00.sqlite3 b/tst/400_xowa/root/file/en.wikipedia.org/fsdb.user/fsdb.atr.00.sqlite3
index ef8dca83e..1b5fbeb31 100644
Binary files a/tst/400_xowa/root/file/en.wikipedia.org/fsdb.user/fsdb.atr.00.sqlite3 and b/tst/400_xowa/root/file/en.wikipedia.org/fsdb.user/fsdb.atr.00.sqlite3 differ
diff --git a/tst/400_xowa/root/file/en.wikipedia.org/wiki.mnt.sqlite3 b/tst/400_xowa/root/file/en.wikipedia.org/wiki.mnt.sqlite3
deleted file mode 100644
index 676765059..000000000
Binary files a/tst/400_xowa/root/file/en.wikipedia.org/wiki.mnt.sqlite3 and /dev/null differ
diff --git a/tst/400_xowa/root/file/en.wikipedia.org/wiki.orig#00.sqlite3 b/tst/400_xowa/root/file/en.wikipedia.org/wiki.orig#00.sqlite3
index 4f402f966..cc7c821ab 100644
Binary files a/tst/400_xowa/root/file/en.wikipedia.org/wiki.orig#00.sqlite3 and b/tst/400_xowa/root/file/en.wikipedia.org/wiki.orig#00.sqlite3 differ
diff --git a/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org.000.sqlite3 b/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org.000.sqlite3
deleted file mode 100644
index 320a2bea6..000000000
Binary files a/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org.000.sqlite3 and /dev/null differ
diff --git a/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org.001.sqlite3 b/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org.001.sqlite3
deleted file mode 100644
index f3c5ffbcb..000000000
Binary files a/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org.001.sqlite3 and /dev/null differ
diff --git a/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org.002.sqlite3 b/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org.002.sqlite3
index 344a1a0ed..6778de16f 100644
Binary files a/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org.002.sqlite3 and b/tst/400_xowa/root/wiki/en.wikipedia.org/en.wikipedia.org.002.sqlite3 differ
diff --git a/xowa_source_v1.11.2.1.7z b/xowa_source_v1.11.2.1.7z
new file mode 100755
index 000000000..c962f0fe6
Binary files /dev/null and b/xowa_source_v1.11.2.1.7z differ