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
2015-08-30 22:57:59 -04:00
parent ed911e3de5
commit 5fc4eb41ec
579 changed files with 2460 additions and 1564 deletions

View File

@@ -89,7 +89,7 @@ public class Gallery_html_wtr {
if ( itm.Link_bgn() != Bry_.NotFound // link is not -1; EX: "A.png" has no link specified
&& (itm.Link_end() - itm.Link_bgn()) > 0 // and link_end - link_bgn > 0; EX: "A.png|link="; DATE:2014-06-15
)
lnki_link_ttl = Xoa_ttl.parse_(wiki, Bry_.Mid(src, itm.Link_bgn(), itm.Link_end()));
lnki_link_ttl = Xoa_ttl.parse(wiki, Bry_.Mid(src, itm.Link_bgn(), itm.Link_end()));
byte[] lnki_href = app.Html__href_wtr().Build_to_bry(wiki, lnki_link_ttl);
byte[] lnki_alt = itm.Alt_bgn() == Bry_.NotFound ? lnki_ttl : Xoh_html_wtr_escaper.Escape(app.Parser_amp_mgr(), tmp_bfr, Bry_.Mid(src, itm.Alt_bgn(), itm.Alt_end()));
img_core_fmtr.Init(itm_elem_id, html_src, html_w, html_h);

View File

@@ -171,14 +171,14 @@ public class Gallery_itm_parser {
cur_itm.Ttl_end_(fld_end);
byte[] ttl_bry = Bry_.Mid(src, cur_itm.Ttl_bgn(), fld_end);
ttl_bry = Xoa_app_.Utl__encoder_mgr().Http_url_ttl().Decode(ttl_bry); // NOTE: must decode url-encoded entries; EX: "A%28b%29.png" -> "A(b).png"; DATE:2014-01-01
Xoa_ttl ttl = Xoa_ttl.parse_(wiki, ttl_bry);
Xoa_ttl ttl = Xoa_ttl.parse(wiki, ttl_bry);
if ( ttl == null // invalid ttl; EX: "<invalid>"
|| ttl.Anch_bgn() == 1 // anchor-only ttl; EX: "#invalid"; DATE:2014-03-18
)
cur_itm.Reset();
else {
if (!ttl.Ns().Id_file_or_media()) // ttl does not have "File:"; MW allows non-ns names; EX: "A.png" instead of "File:A.png"; DATE:2013-11-18
ttl = Xoa_ttl.parse_(wiki, Xow_ns_.Id_file, ttl_bry);
ttl = Xoa_ttl.parse(wiki, Xow_ns_.Id_file, ttl_bry);
cur_itm.Ttl_(ttl);
cur_itm.Ext_(Xof_ext_.new_by_ttl_(ttl_bry));
}

View File

@@ -116,7 +116,7 @@ public abstract class Gallery_mgr_base {
;
Xoa_ttl href_ttl = itm.Link_bgn() == Bry_.NotFound
? ttl
: Xoa_ttl.parse_(wiki, Bry_.Mid(src, itm.Link_bgn(), itm.Link_end()))
: Xoa_ttl.parse(wiki, Bry_.Mid(src, itm.Link_bgn(), itm.Link_end()))
;
if (href_ttl == null) href_ttl = ttl; // occurs when link is invalid; EX: A.png|link=<invalid>
this.Adjust_image_parameters(xfer_itm); // trad=noop; packed=reduce by 1.5