mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.8.5.1'
This commit is contained in:
@@ -170,8 +170,11 @@ public class Xop_tblw_wkr implements Xop_ctx_wkr {
|
||||
if (!tbl_is_xml)
|
||||
ctx.Para().Process_nl(ctx, root, src, bgn_pos, bgn_pos + 1); // simulate "\n"; 2012-12-08
|
||||
int stack_pos = ctx.Stack_idx_typ(Xop_tkn_itm_.Tid_tblw_tr);
|
||||
if (stack_pos != Xop_ctx.Stack_not_found) // don't pop <tr> if none found; PAGE:en.w:Turks_in_Denmark DATE:2014-03-02
|
||||
if ( stack_pos != Xop_ctx.Stack_not_found // don't pop <tr> if none found; PAGE:en.w:Turks_in_Denmark DATE:2014-03-02
|
||||
&& !tbl_is_xml // cur is "|-", not <tr>; PAGE:en.w:Aargau; DATE:2016-08-14
|
||||
) {
|
||||
ctx.Stack_pop_til(root, src, stack_pos, true, bgn_pos, bgn_pos, Xop_tkn_itm_.Tid_tblw_td);
|
||||
}
|
||||
break;
|
||||
case Xop_tkn_itm_.Tid_tblw_tr: // fix; <tr><tr> -> <tr>
|
||||
if (prv_tkn.Tblw_subs_len() == 0) { // NOTE: set prv_row to ignore, but do not pop; see Tr_dupe_xnde and [[Jupiter]]; only invoke if same type; EX: <tr><tr> but not |-<tr>; DATE:2013-12-09
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.parsers.tblws; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
|
||||
import org.junit.*;
|
||||
public class Xop_tblw_wkr__tblx_tst {
|
||||
@Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt();
|
||||
@Before public void init() {fxt.Reset(); fxt.Init_para_y_();} private final Xop_fxt fxt = new Xop_fxt();
|
||||
@After public void term() {fxt.Init_para_n_();}
|
||||
@Test public void Ignore_td() { // PURPOSE: do not parse pipe as td if in <table>; EX:ru.w:Сочи; DATE:2014-02-22
|
||||
fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last
|
||||
@@ -129,4 +129,26 @@ public class Xop_tblw_wkr__tblx_tst {
|
||||
)
|
||||
);
|
||||
}
|
||||
@Test public void Ignore_tr_in_lnki() { // PURPOSE: <tr> fragment within lnki should be ignored; PAGE:en.w:Aargau DATE:2016-08-14
|
||||
fxt.Test_parse_page_wiki_str(String_.Concat_lines_nl_skip_last
|
||||
( "<table>"
|
||||
, "<tr>"
|
||||
, "<td>[[A|B<tr><td>t_1</td></tr>]]"
|
||||
, "</td>"
|
||||
, "</tr>"
|
||||
, "</table>"
|
||||
) , String_.Concat_lines_nl_skip_last
|
||||
( "<table>"
|
||||
, " <tr>"
|
||||
, " <td><a href=\"/wiki/A\">B"
|
||||
, " <tr>"
|
||||
, " <td>t_1"
|
||||
, " </td>"
|
||||
, " </tr>"
|
||||
, "</a>"
|
||||
, " </td>"
|
||||
, " </tr>"
|
||||
, "</table>"
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,5 +60,5 @@ public class Xop_tblw_ws_itm {
|
||||
int tag_name_len = tag_name.length;
|
||||
trie.Add_obj(Bry_.Add(Bry_xnde_bgn, tag_name), new Xop_tblw_ws_itm(Type_xnde, tag_name_len));
|
||||
trie.Add_obj(Bry_.Add(Bry_xnde_end, tag_name), new Xop_tblw_ws_itm(Type_xnde, tag_name_len + 1));
|
||||
} static byte[] Bry_xnde_bgn = new byte[] {Byte_ascii.Lt, Byte_ascii.Slash}, Bry_xnde_end = new byte[] {Byte_ascii.Lt};
|
||||
} private static byte[] Bry_xnde_bgn = new byte[] {Byte_ascii.Lt, Byte_ascii.Slash}, Bry_xnde_end = new byte[] {Byte_ascii.Lt};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user