mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.11.1.1
This commit is contained in:
@@ -41,7 +41,7 @@ public class Xoa_url__to_str__tst {
|
||||
@Test public void Alias() {
|
||||
fxt.Prep_add_xwiki_to_wiki("wikt", "en.wiktionary.org");
|
||||
Xow_wiki en_d = fxt.Prep_create_wiki("en.wiktionary.org");
|
||||
en_d.Ns_mgr().Ns_main().Case_match_(Xow_ns_case_.Id_all);
|
||||
en_d.Ns_mgr().Ns_main().Case_match_(Xow_ns_case_.Tid__all);
|
||||
fxt.Chk_to_str_href(Bool_.N, "/wiki/wikt:a" , "en.wiktionary.org/wiki/a");
|
||||
}
|
||||
@Test public void Unknown() {fxt.Chk_to_str_href(Bool_.N, "/wiki/{{{extlink}}}" , "");} // {{{extlink}}} not a valid title; return empty
|
||||
|
||||
@@ -238,7 +238,7 @@ public class Xoa_url_parser {
|
||||
private byte[] Bld_page_by_alias(byte[] bry) {
|
||||
if (bry == null) return null;
|
||||
int colon_pos = Bry_find_.Find_fwd(bry, Byte_ascii.Colon); // check for colon; EX: commons:Earth
|
||||
if (colon_pos == Bry_.NotFound) return null; // no colon
|
||||
if (colon_pos == Bry_find_.Not_found) return null; // no colon
|
||||
Xow_wiki alias_wiki = wiki; // default alias_wiki to cur_wiki
|
||||
if (!tmp_wiki_is_missing) // tmp_wiki exists; use it for alias wikis; DATE:2015-09-17
|
||||
alias_wiki = wiki.App().Wiki_mgri().Get_by_key_or_make_init_n(tmp_wiki);
|
||||
|
||||
@@ -56,10 +56,10 @@ public class Xoa_url_parser__xwiki_tst {
|
||||
Xowe_wiki en_d = tstr.Prep_create_wiki("en.wiktionary.org");
|
||||
Xow_ns_mgr ns_mgr = en_d.Ns_mgr();
|
||||
|
||||
ns_mgr.Ns_main().Case_match_(Xow_ns_case_.Id_all);
|
||||
ns_mgr.Ns_main().Case_match_(Xow_ns_case_.Tid__all);
|
||||
tstr.Run_parse("en.wiktionary.org/wiki/a").Chk_wiki("en.wiktionary.org").Chk_page("a");
|
||||
|
||||
ns_mgr.Ns_category().Case_match_(Xow_ns_case_.Id_all);
|
||||
ns_mgr.Ns_category().Case_match_(Xow_ns_case_.Tid__all);
|
||||
tstr.Run_parse("en.wiktionary.org/wiki/Category:a").Chk_wiki("en.wiktionary.org").Chk_page("Category:a");
|
||||
|
||||
tstr.Run_parse("en.wiktionary.org/wiki/A/B/C").Chk_page("A/B/C");
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Xoav_url_parser {
|
||||
}
|
||||
private int Parse_wiki(Xoav_url rv, byte[] src, int src_len, int pos) {
|
||||
int wiki_bgn = pos + Bry_site.length;
|
||||
int wiki_end = Bry_find_.Find_fwd(src, Byte_ascii.Slash, wiki_bgn, src_len); if (wiki_end == Bry_.NotFound) throw Err_.new_wo_type("could not find wiki_end", "src", String_.new_u8(src));
|
||||
int wiki_end = Bry_find_.Find_fwd(src, Byte_ascii.Slash, wiki_bgn, src_len); if (wiki_end == Bry_find_.Not_found) throw Err_.new_wo_type("could not find wiki_end", "src", String_.new_u8(src));
|
||||
rv.Wiki_bry_(Bry_.Mid(src, wiki_bgn, wiki_end));
|
||||
return wiki_end;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user