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

Parser.Ref: Add commented fix for ref tag in template

This commit is contained in:
gnosygnu
2017-03-30 22:11:00 -04:00
parent 3023353154
commit 3441135fad
11 changed files with 95 additions and 38 deletions

View File

@@ -33,8 +33,9 @@ public class Xoh_make_fxt {
) {
// fxt.Init_cache("en.wikipedia.org", "A.png", 0, 220, 110, 0.5, -1, -1, Bool_.Y, "B.png", 330, 110, -1, -1);
}
public void Test__html(String wtxt, String expd) {
expd = String_.Replace(expd, "'", "\"");
public void Test__html(String wtxt, String expd) {Test__html(wtxt, expd, true);}
public void Test__html(String wtxt, String expd, boolean escape_apos) {
if (escape_apos) expd = String_.Replace(expd, "'", "\"");
String actl = parser_fxt.Exec__parse_to_hdump(wtxt);
Tfds.Eq_str_lines(expd, actl);
}

View File

@@ -35,13 +35,13 @@ public class Xoh_hdr_html_tst {
));
}
@Test public void Uniq() {
byte[] uniq = fxt.Parser_fxt().Wiki().Parser_mgr().Uniq_mgr().Add(Bry_.new_a7("bcd"));
fxt.Test__html(String_.Concat_lines_nl_skip_last
( "== a" + String_.new_u8(uniq) + "e =="
( "== a <math>c</math> e =="
, "text"
), String_.Concat_lines_nl_skip_last
( "<h2><span class='mw-headline' id='abcde'> abcde </span></h2>"
( "<h2><span class=\"mw-headline\" id=\"a_c_e\"> a <span id='xowa_math_txt_0'>c</span> e </span></h2>"
, "text"
));
)
, false);
}
}

View File

@@ -217,7 +217,7 @@ public class Xow_popup_parser {
int subs_len = tmpl_root.Subs_len();
for (int i = 0; i < subs_len; i++)
tmpl_root.Subs_get(i).Tmpl_compile(tmpl_ctx, src, tmpl_props);
return Xot_tmpl_wtr.Instance.Write_all(tmpl_ctx, tmpl_root, src);
return Xot_tmpl_wtr.Write_all(tmpl_ctx, tmpl_root, src);
}
}
class Xow_popup_parser_ {