mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Parser: Fix broken tables on a few dozen en.w pages
This commit is contained in:
parent
ccd8b204c5
commit
7bd176f51f
@ -373,7 +373,9 @@ public class Xop_fxt {
|
||||
Tfds.Eq_str_lines(gplx.langs.htmls.Gfh_utl.Replace_apos(expd), actl, raw);
|
||||
}
|
||||
|
||||
public void Test_str_full(String raw, String expd, String actl) {Tfds.Eq_str_lines(expd, actl, raw);}
|
||||
public void Test_str_full(String raw, String expd, String actl) {
|
||||
Tfds.Eq_str_lines(expd, actl, raw);
|
||||
}
|
||||
public void Test_str_part_y(String actl, String... expd_parts) {
|
||||
int expd_parts_len = expd_parts.length;
|
||||
for (int i = 0; i < expd_parts_len; i++) {
|
||||
|
@ -89,12 +89,13 @@ public class Xop_list_wkr implements Xop_ctx_wkr {
|
||||
ctx.Empty_ignored_y_();
|
||||
}
|
||||
}
|
||||
if (allDd && cur_pos < src_len - 2 && src[cur_pos] == '{' && src[cur_pos + 1] == '|') // NOTE: if indent && next == {| then invoke table; EX: ":::{|"
|
||||
return ctx.Tblw().Make_tkn_bgn(ctx, tkn_mkr, root, src, src_len, cur_pos, cur_pos + 2, false, Xop_tblw_wkr.Tblw_type_tb, Xop_tblw_wkr.Called_from_list, -1, -1); // NOTE: ws_enabled must be set to true; see test for Adinkras; Cato the Elder
|
||||
else {
|
||||
dd_chk = symByt == Xop_list_tkn_.List_itmTyp_dt;
|
||||
return cur_pos;
|
||||
if (allDd) { // NOTE: if indent && next == {| then invoke table; EX: ":::{|"
|
||||
int tblw_bgn = Bry_find_.Find_fwd_while(src, cur_pos, src_len, Byte_ascii.Space); // skip spaces; EX: ": {|" DATE:2017-01-26
|
||||
if (tblw_bgn < src_len - 2 && src[tblw_bgn] == '{' && src[tblw_bgn + 1] == '|') // check if next chars are "{|"
|
||||
return ctx.Tblw().Make_tkn_bgn(ctx, tkn_mkr, root, src, src_len, tblw_bgn, tblw_bgn+ 2, false, Xop_tblw_wkr.Tblw_type_tb, Xop_tblw_wkr.Called_from_list, -1, -1); // NOTE: ws_enabled must be set to true; see test for Adinkras; Cato the Elder
|
||||
}
|
||||
dd_chk = symByt == Xop_list_tkn_.List_itmTyp_dt;
|
||||
return cur_pos;
|
||||
}
|
||||
public void MakeTkn_end(Xop_ctx ctx, Xop_tkn_mkr tkn_mkr, Xop_root_tkn root, byte[] src, int src_len, int bgn_pos, int cur_pos, Xop_list_tkn bgn, byte sub_last) {
|
||||
// boolean empty_ignored = ctx.Empty_ignored(); // commented; see below; DATE:2014-06-24
|
||||
|
@ -260,6 +260,20 @@ public class Xop_list_wkr_basic_tst {
|
||||
, fxt.tkn_list_end_(10).List_path_(0)
|
||||
);
|
||||
}
|
||||
@Test public void Mix_tblw_w_space() {
|
||||
fxt.Test_html_full_str(": {|\n|a\n|}", String_.Concat_lines_nl_skip_last
|
||||
( "<dl>"
|
||||
, " <dd>"
|
||||
, " <table>"
|
||||
, " <tr>"
|
||||
, " <td>a"
|
||||
, " </td>"
|
||||
, " </tr>"
|
||||
, " </table>"
|
||||
, " </dd>"
|
||||
, "</dl>"
|
||||
));
|
||||
}
|
||||
@Test public void Dif_lvls_1_3_1() {
|
||||
fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last
|
||||
( "*1"
|
||||
|
Loading…
Reference in New Issue
Block a user