mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.8.5.1
This commit is contained in:
@@ -19,7 +19,7 @@ package gplx.xowa; import gplx.*;
|
||||
public class Xop_lnki_align_h {
|
||||
public static final byte Null = 0, None = 1, Left = 2, Center = 3, Right = 4;
|
||||
public static final byte[][] Html_names = new byte[][]
|
||||
{ Bry_.new_a7("null")
|
||||
{ Object_.Bry__null
|
||||
, Bry_.new_a7("none")
|
||||
, Bry_.new_a7("left")
|
||||
, Bry_.new_a7("center")
|
||||
|
||||
@@ -130,7 +130,7 @@ public class Xop_lnki_arg_parser {
|
||||
int len = digit_mgr.Len(); // NOTE: add non-english numbers; EX: ۲۰۰px; DATE:2015-07-18
|
||||
for (int i = 0; i < len; ++i) {
|
||||
KeyVal kv = digit_mgr.Get_at(i);
|
||||
int num = (byte)Int_.parse_or_(kv.Key(), -1); if (num == -1) continue; // ignore separators; EX: "," "."
|
||||
int num = (byte)Int_.parse_or(kv.Key(), -1); if (num == -1) continue; // ignore separators; EX: "," "."
|
||||
size_trie.Add((byte[])kv.Val(), Byte_obj_val.new_((byte)num)); // NOTE: num corresponds to dim_d0 -> d9 below
|
||||
}
|
||||
size_trie.Add(Byte_ascii.Space, Byte_obj_val.new_(Key_space));
|
||||
|
||||
@@ -53,7 +53,7 @@ public class Xop_lnki_wkr_ {
|
||||
tmp_bfr.Mkr_rls();
|
||||
}
|
||||
Xowe_wiki wiki = ctx.Wiki();
|
||||
Xoa_ttl ttl = Xoa_ttl.parse_(wiki, ttl_bry);
|
||||
Xoa_ttl ttl = Xoa_ttl.parse(wiki, ttl_bry);
|
||||
if (ttl == null) return false;
|
||||
if ( wiki.Cfg_parser_lnki_xwiki_repos_enabled() // wiki has lnki.xwiki_repos
|
||||
&& ttl.Wik_bgn() != Xoa_ttl.Null_wik_bgn // xwiki available; EX: [[en:]]
|
||||
@@ -70,7 +70,7 @@ public class Xop_lnki_wkr_ {
|
||||
if (xwiki_bry_len + 1 >= ttl_bry_len) return ttl; // invalid ttl; EX: [[en:]]
|
||||
byte[] ttl_in_xwiki_bry = Bry_.Mid(ttl_bry, xwiki_bry_len + 1, ttl_bry_len); // +1 to position after xwiki :; EX: [[en:File:A.png]]; +1 to put after ":" at "F"
|
||||
if (!wiki.Cfg_parser().Lnki_cfg().Xwiki_repo_mgr().Has(xwiki_bry)) return ttl; // alias not in xwikis; EX: [[en_bad:File:A.png]]
|
||||
Xoa_ttl ttl_in_xwiki = Xoa_ttl.parse_(wiki, ttl_in_xwiki_bry);
|
||||
Xoa_ttl ttl_in_xwiki = Xoa_ttl.parse(wiki, ttl_in_xwiki_bry);
|
||||
if (ttl_in_xwiki == null) return ttl; // occurs if ttl is bad in xwiki; EX: [[en:<bad>]]
|
||||
return ttl_in_xwiki.Ns().Id_file() ? ttl_in_xwiki : ttl;
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ public class Xop_lnki_wkr__basic_tst {
|
||||
, " <div class=\"thumbcaption\">"
|
||||
, " <div class=\"magnify\">"
|
||||
, " <a href=\"/wiki/File:A.png\" class=\"inte" +"rnal\" title=\"Enlarge\">"
|
||||
, " <img src=\"file:///mem/xowa/user/test_user/app/img/file/magnify-clip.png\" width=\"15\" height=\"11\" alt=\"\" />"
|
||||
, " <img src=\"file:///mem/xowa/bin/any/xowa/file/mediawiki.file/magnify-clip.png\" width=\"15\" height=\"11\" alt=\"\" />"
|
||||
, " </a>"
|
||||
, " </div>"
|
||||
, " b <sup id=\"cite_ref-0\" class=\"reference\"><a href=\"#cite_note-0\">[1]</a></sup>"
|
||||
@@ -301,7 +301,7 @@ public class Xop_lnki_wkr__basic_tst {
|
||||
}
|
||||
@Test public void Visited() { // PURPOSE: show redirected titles as visited; EX:fr.w:Alpes_Pennines; DATE:2014-02-28
|
||||
Xowe_wiki wiki = fxt.Wiki();
|
||||
Xoa_ttl ttl = Xoa_ttl.parse_(wiki, Bry_.new_a7("Src")); // simulate requrest for "Src" page
|
||||
Xoa_ttl ttl = Xoa_ttl.parse(wiki, Bry_.new_a7("Src")); // simulate requrest for "Src" page
|
||||
Xoae_page previous_page = Xoae_page.test_(wiki, ttl);
|
||||
previous_page.Redirected_ttls().Add(Bry_.new_a7("Src")); // simulate redirect from "Src"
|
||||
fxt.App().Usere().History_mgr().Add(previous_page); // simulate "Src" already being clicked once; this is the key call
|
||||
|
||||
@@ -97,7 +97,7 @@ public class Xop_lnki_wkr__pre_tst {
|
||||
, " <div class=\"thumbcaption\">"
|
||||
, " <div class=\"magnify\">"
|
||||
, " <a href=\"/wiki/File:A.png\" class=\"internal\" title=\"Enlarge\">"
|
||||
, " <img src=\"file:///mem/xowa/user/test_user/app/img/file/magnify-clip.png\" width=\"15\" height=\"11\" alt=\"\" />"
|
||||
, " <img src=\"file:///mem/xowa/bin/any/xowa/file/mediawiki.file/magnify-clip.png\" width=\"15\" height=\"11\" alt=\"\" />"
|
||||
, " </a>"
|
||||
, " </div>"
|
||||
, " "
|
||||
|
||||
@@ -40,8 +40,8 @@ public class Xop_lnki_wkr__size_tst {
|
||||
@Test public void Large_number() { // PURPOSE: perf code identified large sizes as caption; DATE:2014-02-15
|
||||
fxt.Test_parse_page_wiki("[[Image:a|1234567890x1234567890px]]" , fxt.tkn_lnki_().Width_(1234567890).Height_(1234567890));
|
||||
}
|
||||
@Test public void Large_number__discard_if_gt_int() { // PURPOSE: size larger than int should be discarded, not be Int_.MaxValue: PAGE:id.w:Baho; DATE:2014-06-10
|
||||
fxt.Test_html_wiki_frag("[[File:A.png|9999999999x30px]]", " width=\"0\" height=\"30\""); // width should not be Int_.MaxValue
|
||||
@Test public void Large_number__discard_if_gt_int() { // PURPOSE: size larger than int should be discarded, not be Int_.Max_value: PAGE:id.w:Baho; DATE:2014-06-10
|
||||
fxt.Test_html_wiki_frag("[[File:A.png|9999999999x30px]]", " width=\"0\" height=\"30\""); // width should not be Int_.Max_value
|
||||
}
|
||||
@Test public void Dangling_xnde() { // PURPOSE: dangling xnde should not eat rest of lnki; PAGE:sr.w:Сићевачка_клисура DATE:2014-07-03
|
||||
fxt.Init_log_(Xop_xnde_log.Dangling_xnde).Test_parse_page_wiki("[[Image:a.png|<b>c|40px]]" , fxt.tkn_lnki_().Width_(40).Height_(-1));
|
||||
|
||||
Reference in New Issue
Block a user