1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Page_sync: Fix page_sync failing when (a) page has math and (b) math has '~{'

This commit is contained in:
gnosygnu
2016-11-17 16:10:24 -05:00
parent a38c0e834e
commit 9aa3902265
4 changed files with 25 additions and 8 deletions

View File

@@ -46,8 +46,13 @@ public class Gfo_usr_dlg_base implements Gfo_usr_dlg {
}
private String Bld_msg_many(String grp_key, String msg_key, String fmt, Object[] args) {
synchronized (tmp_fmtr) {
tmp_fmtr.Fmt_(fmt).Bld_bfr_many(tmp_bfr, args);
return tmp_bfr.To_str_and_clear();
try {
tmp_fmtr.Fmt_(fmt).Bld_bfr_many(tmp_bfr, args);
return tmp_bfr.To_str_and_clear();
}
catch (Exception e) { // NOTE: can fail if fmt has ~{}; callers should proactively remove, but for now, just return fmt if fails; EX:Page_sync and en.w:Web_crawler; DATE:2016-11-17
return fmt;
}
}
}
private String Bld_msg_one(String grp_key, String msg_key, String fmt, Object val) {

View File

@@ -47,6 +47,8 @@ public class Bry_rdr {
public int Find_fwd_rr() {return Find_fwd(dflt_dlm , Bool_.N, Bool_.N, Fail_if_missing);}
public int Find_fwd_rr(byte find) {return Find_fwd(find , Bool_.N, Bool_.N, Fail_if_missing);}
public int Find_fwd_rr(byte[] find) {return Find_fwd(find , Bool_.N, Bool_.N, Fail_if_missing);}
public int Find_fwd_rr_or(byte[] find, int or)
{return Find_fwd(find , Bool_.N, Bool_.N, or);}
private int Find_fwd(byte find, boolean ret_lhs, boolean pos_lhs, int or) {
int find_pos = Bry_find_.Find_fwd(src, find, pos, src_end);
if (find_pos == Bry_find_.Not_found) {