mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.7.3.1'
This commit is contained in:
@@ -27,7 +27,7 @@ public class Math_nde implements Xox_xnde {
|
||||
if (math_mgr.Enabled() && math_mgr.Renderer_is_mathjax())
|
||||
ctx.Page().Html_data().Head_mgr().Itm__mathjax().Enabled_y_();
|
||||
}
|
||||
public void Xtn_write(Bry_bfr bfr, Xoae_app app, Xop_ctx ctx, Xoh_html_wtr html_wtr, Xoh_wtr_ctx hctx, Xop_xnde_tkn xnde, byte[] src) {
|
||||
public void Xtn_write(Bry_bfr bfr, Xoae_app app, Xop_ctx ctx, Xoh_html_wtr html_wtr, Xoh_wtr_ctx hctx, Xoae_page wpg, Xop_xnde_tkn xnde, byte[] src) {
|
||||
app.File_mgr().Math_mgr().Html_wtr().Write(html_wtr, ctx, hctx, bfr, src, xnde);
|
||||
}
|
||||
public static Xop_log_basic_wkr Log_wkr = Xop_log_basic_wkr.Null;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class Xof_math_html_wtr {
|
||||
byte[] math_bry = Bry_.Mid(src, xnde.Tag_open_end(), xnde.Tag_close_bgn());
|
||||
Bry_bfr tmp_bfr = app.Utl__bfr_mkr().Get_b512().Mkr_rls();
|
||||
math_bry = Escape_tex(tmp_bfr, !renderer_is_latex, math_bry);
|
||||
byte[] math_bry_clean = app.Html_mgr().Js_cleaner().Clean(wiki, math_bry, 0, math_bry.length); // check for js;
|
||||
byte[] math_bry_clean = wiki.Html_mgr().Js_cleaner().Clean(wiki, math_bry, 0, math_bry.length); // check for js;
|
||||
if (math_bry_clean != null) math_bry = math_bry_clean; // js found; use clean version; DATE:2013-08-26
|
||||
boolean enabled = app.File_mgr().Math_mgr().Enabled();
|
||||
if (renderer_is_latex && app.File_mgr().Math_mgr().Find_itm(tmp_math_itm, page.Wiki().Domain_str(), math_bry)) {
|
||||
|
||||
@@ -18,7 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.xtns.math.texvcs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.math.*;
|
||||
import gplx.core.btries.*;
|
||||
import gplx.xowa.xtns.math.texvcs.lxrs.*; import gplx.xowa.xtns.math.texvcs.tkns.*;
|
||||
class Texvc_parser {
|
||||
class Texvc_parser {
|
||||
private final Btrie_rv trv = new Btrie_rv();
|
||||
public void Parse(Texvc_ctx ctx, Texvc_root root, byte[] src) {
|
||||
int src_len = src.length;
|
||||
ctx.Clear();
|
||||
@@ -30,13 +31,13 @@ class Texvc_parser {
|
||||
int txt_bgn = pos, txt_uid = -1;
|
||||
byte b = src[pos];
|
||||
while (true) {
|
||||
Object o = lxr_trie.Match_bgn_w_byte(b, src, pos, src_len);
|
||||
Object o = lxr_trie.Match_at_w_b0(trv, b, src, pos, src_len);
|
||||
if (o == null) // no lxr found; char is txt; increment pos
|
||||
pos++;
|
||||
else { // lxr found
|
||||
Texvc_lxr lxr = (Texvc_lxr)o;
|
||||
if (txt_bgn != pos) txt_uid = Txt_calc(ctx, root, src, src_len, pos, txt_bgn, txt_uid);// chars exist between pos and txt_bgn; make txt_tkn;
|
||||
pos = lxr.Make_tkn(ctx, root, src, src_len, pos, lxr_trie.Match_pos());
|
||||
pos = lxr.Make_tkn(ctx, root, src, src_len, pos, trv.Pos());
|
||||
if (pos > 0) {txt_bgn = pos; txt_uid = -1;} // reset txt_tkn
|
||||
}
|
||||
if (pos == end_pos) break;
|
||||
|
||||
Reference in New Issue
Block a user