1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2014-09-28 23:43:46 -04:00
parent 314de43d76
commit 81c8e2554c
117 changed files with 3079 additions and 2223 deletions

View File

@@ -213,9 +213,12 @@ public class Xoa_ttl { // PAGE:en.w:http://en.wikipedia.org/wiki/Help:Link; REF.
if (amp_itm.Tid() == Xop_amp_trie_itm.Tid_name) {
switch (amp_itm.Char_int()) {
case 160: // NOTE: &nbsp must convert to space; EX:w:United States [[Image:Dust Bowl - Dallas, South Dakota 1936.jpg|220px|alt=]]
b_ary = Bry_space;
break;
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
cur = match_pos; // set cur after ";"
continue;
case Byte_ascii.Amp:
b_ary = Byte_ascii.Amp_bry; // NTOE: if & convert to &; PAGE:en.w:Amadou Bagayoko?redirect=n; DATE:2014-09-23
break;
case Byte_ascii.Quote:
case Byte_ascii.Lt:
case Byte_ascii.Gt:
@@ -352,7 +355,6 @@ public class Xoa_ttl { // PAGE:en.w:http://en.wikipedia.org/wiki/Help:Link; REF.
tors_txt = tors_ns.Name_txt_w_colon();
return true;
}
private byte[] Bry_space = Bry_.new_ascii_(" ");
public static byte[] Replace_spaces(byte[] raw) {return Bry_.Replace(raw, Byte_ascii.Space, Byte_ascii.Underline);}
public static byte[] Replace_unders(byte[] raw) {return Bry_.Replace(raw, Byte_ascii.Underline, Byte_ascii.Space);}
private int wik_bgn = -1, ns_bgn = -1, page_bgn = 0, leaf_bgn = -1, anch_bgn = -1, root_bgn = -1;

View File

@@ -36,6 +36,7 @@ public class Xop_redirect_mgr_tst {
}
@Test public void Url_decode() {fxt.Test_redirect("#REDIRECT [[A%28B%29]]" , "A(B)");} // PURPOSE: url-decode links; PAGE:en.w:Watcher_(Buffy_the_Vampire_Slayer); DATE:2014-08-18
@Test public void Url_decode_plus() {fxt.Test_redirect("#REDIRECT [[A%28B%29+]]", "A(B)+");} // PURPOSE: do not url-decode +; PAGE:en.w:Template:Positionskarte+; DATE:2014-08-22
@Test public void Amp() {fxt.Test_redirect("#REDIRECT [[A & B]]", "A & B");} // PURPOSE: & -> &; PAGE:en.w:Amadou Bagayoko?redirect=n; DATE:2014-09-23
@Test public void Frame_ttl() { // PURPOSE: redirect should set invk frame title to redirect_trg, not original; PAGE:en.w:Statutory_city DATE:2014-08-22
fxt.Test_frame_ttl("Template:A", "#REDIRECT [[Template:B]]", "Template:B", "Template:B");
}