|
|
|
@ -27,15 +27,9 @@ public class Xoh_file_fmtr__hdump extends Xoh_file_fmtr__basic { private final
|
|
|
|
|
byte[] data_xowa_title = Gfh_atr_.Make(tmp_bfr, Xoh_img_xoimg_data.Bry__data_xowa_title, a_xowa_title);
|
|
|
|
|
byte[] data_xowa_image = Bld_xowa_image_data(tmp_bfr, xfer_itm.Lnki_type(), xfer_itm.Lnki_w(), xfer_itm.Lnki_h(), xfer_itm.Lnki_upright(), xfer_itm.Lnki_time(), xfer_itm.Lnki_page());
|
|
|
|
|
|
|
|
|
|
// only write src="..." width="..." height="..." if orig is present or if Hzip__none (Hzip__none should always write title and image)
|
|
|
|
|
if (!xfer_itm.Orig_exists() || hctx.Hzip_tid() == gplx.xowa.htmls.core.hzips.Xoh_hzip_dict_.Hzip__none) {
|
|
|
|
|
img_w = img_h = 0;
|
|
|
|
|
img_src = Bry_.Empty;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
data_xowa_title = Bry_.Empty;
|
|
|
|
|
data_xowa_image = Bry_.Empty;
|
|
|
|
|
}
|
|
|
|
|
// always null out w, h, src; Hdb__hzip and Hdb__htxt should never write src; Hdb__page_sync will never come here; ISSUE#:553; DATE:2019-09-25
|
|
|
|
|
img_w = img_h = 0;
|
|
|
|
|
img_src = Bry_.Empty;
|
|
|
|
|
|
|
|
|
|
// bld bfr
|
|
|
|
|
if (Bry_.Len_eq_0(a_href))
|
|
|
|
@ -44,12 +38,12 @@ public class Xoh_file_fmtr__hdump extends Xoh_file_fmtr__basic { private final
|
|
|
|
|
if (a_href_is_file) a_href = Bry_.Empty;
|
|
|
|
|
fmt__anch_y.Bld_many(bfr
|
|
|
|
|
, a_href, Xoh_lnki_consts.A_cls_to_bry(a_cls), Xoh_lnki_consts.A_rel_to_bry(a_rel), a_title, a_xowa_title
|
|
|
|
|
, data_xowa_title, data_xowa_image, img_src, img_w, img_h, Xoh_img_cls_.To_html(img_cls, img_cls_other), Gfh_utl.Escape_html_as_bry(img_alt)
|
|
|
|
|
, data_xowa_title, data_xowa_image, Gfh_utl.Escape_html_as_bry(img_alt), img_src, img_w, img_h, Xoh_img_cls_.To_html(img_cls, img_cls_other)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public static void Add_anch_n(Bry_bfr bfr, byte[] data_xowa_title, byte[] data_xowa_image, byte[] img_src, int img_w, int img_h, byte img_cls, byte[] img_cls_other, byte[] img_alt, byte[] img_xtra_atrs) {
|
|
|
|
|
fmt__anch_n.Bld_many(bfr, data_xowa_title, data_xowa_image, img_src, img_w, img_h, Xoh_img_cls_.To_html(img_cls, img_cls_other), Gfh_utl.Escape_html_as_bry(img_alt), img_xtra_atrs);
|
|
|
|
|
fmt__anch_n.Bld_many(bfr, data_xowa_title, data_xowa_image, Gfh_utl.Escape_html_as_bry(img_alt), img_src, img_w, img_h, Xoh_img_cls_.To_html(img_cls, img_cls_other), img_xtra_atrs);
|
|
|
|
|
}
|
|
|
|
|
public static byte[] Bld_xowa_image_data(Bry_bfr bfr, byte tid, int w, int h, double upright, double time, int page) {
|
|
|
|
|
bfr.Add_byte_space().Add(Xoh_img_xoimg_data.Bry__data_xowa_image).Add_byte_eq().Add_byte_quote();
|
|
|
|
@ -63,11 +57,11 @@ public class Xoh_file_fmtr__hdump extends Xoh_file_fmtr__basic { private final
|
|
|
|
|
}
|
|
|
|
|
private static final Bry_fmt
|
|
|
|
|
fmt__anch_n = Bry_fmt.Auto
|
|
|
|
|
( "<img~{data_xowa_title}~{data_xowa_image} src=\"~{img_src}\" width=\"~{img_w}\" height=\"~{img_h}\"~{img_cls} alt=\"~{img_alt}\"~{img_xtra_atrs}/>"
|
|
|
|
|
( "<img~{data_xowa_title}~{data_xowa_image} alt=\"~{img_alt}\" src=\"~{img_src}\" width=\"~{img_w}\" height=\"~{img_h}\"~{img_cls}~{img_xtra_atrs}/>"
|
|
|
|
|
)
|
|
|
|
|
, fmt__anch_y = Bry_fmt.Auto
|
|
|
|
|
( "<a href=\"~{a_href}\"~{a_class}~{a_rel}~{a_title} xowa_title=\"~{a_xowa_title}\">"
|
|
|
|
|
+ "<img~{data_xowa_title}~{data_xowa_image} src=\"~{img_src}\" width=\"~{img_w}\" height=\"~{img_h}\"~{img_cls} alt=\"~{img_alt}\"/>"
|
|
|
|
|
+ "<img~{data_xowa_title}~{data_xowa_image} alt=\"~{img_alt}\" src=\"~{img_src}\" width=\"~{img_w}\" height=\"~{img_h}\"~{img_cls}/>"
|
|
|
|
|
+ "</a>"
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|