mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v1.10.4.1
This commit is contained in:
@@ -56,10 +56,10 @@ public class Xoh_href_parser {
|
||||
rv.Tid_(Xoh_href.Tid_anchor);
|
||||
rv.Wiki_(wiki.Domain_bry()); // wiki is always current
|
||||
rv.Page_(cur_page); // page is always current
|
||||
rv.Anchor_(Bry_.Mid(raw, file_slash_end + 1, raw_len)); // +1 to skip #; i.e. Anchor should be "A" not "#A"
|
||||
rv.Anchor_(Bry_.Mid(raw, file_slash_end + 1, raw_len)); // +1 to skip #; i.e. Anchor should be "A" not "#A"
|
||||
return;
|
||||
}
|
||||
Object seg_obj = segs.Match_bgn(raw, bgn, raw_len); // match /wiki/ or /site/ or /xcmd/
|
||||
Object seg_obj = segs.Match_bgn(raw, bgn, raw_len); // match /wiki/ or /site/ or /xcmd/
|
||||
if (seg_obj == null) // nothing matched; assume file; EX: file:///C/dir/fil.txt -> /C/dir/fil.txt
|
||||
rv.Tid_(Xoh_href.Tid_file);
|
||||
else { // something matched;
|
||||
@@ -144,7 +144,7 @@ public class Xoh_href_parser {
|
||||
rv.Wiki_(ttl.Wik_itm().Domain()); // wiki is the xwiki prefix; EX: "en.wikpedia.org//wiki/fr:A" -> "fr.wikpedia.org/wiki/A"
|
||||
}
|
||||
byte[] page_bry = encoder.Decode(ttl.Full_txt()); // note that Full is everything except for ns, so it handles "fr:A" ("fr:" being treated as ns, so only "A" will be Full_txt)
|
||||
if (Bry_.Len_eq_0(page_bry)) // handle xwiki hrefs like "fr:"; EX: "/wiki/wikipedia:" on en.wikisource.org/Main Page
|
||||
if (Bry_.Len_eq_0(page_bry)) // handle xwiki hrefs like "fr:"; EX: "/wiki/wikipedia:" on en.wikisource.org/Main Page
|
||||
page_bry = Xoa_page_.Main_page_bry_empty;
|
||||
// if (ttl.Qarg_bgn() != Bry_.NotFound)
|
||||
// rv.Qarg_(ttl.Qarg_txt());
|
||||
@@ -163,9 +163,9 @@ public class Xoh_href_parser {
|
||||
rv.Wiki_(wiki_bry);
|
||||
int page_pos = slash + Href_wiki_len;
|
||||
byte[] page_bry = page_pos < len
|
||||
? Bry_.Mid(raw, page_pos, len) // page is text after next "/" + "/wiki/";
|
||||
? Bry_.Mid(raw, page_pos, len) // page is text after next "/" + "/wiki/";
|
||||
: Bry_.Empty;
|
||||
if (Bry_.Len_eq_0(page_bry)) // handle "/site/fr.wikipedia.org/wiki/"; note that these are generated by [[fr:]]
|
||||
if (Bry_.Len_eq_0(page_bry)) // handle "/site/fr.wikipedia.org/wiki/"; note that these are generated by [[fr:]]
|
||||
page_bry = wiki.Props().Main_page(); // default to Main Page
|
||||
// int qarg_pos = Bry_finder.Find_bwd(page_bry, Byte_ascii.Question);
|
||||
// byte[] qarg_bry = null;
|
||||
|
||||
Reference in New Issue
Block a user