1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-10-27 20:34:16 +00:00

Parser: Comment|Terminate comment if new-line found [#437]

This commit is contained in:
gnosygnu 2019-04-27 09:00:30 -04:00
parent f895259be6
commit 4a1b2e25c0
2 changed files with 19 additions and 1 deletions

View File

@ -55,6 +55,7 @@ public class Xop_comm_lxr implements Xop_lxr {
break;
case Xop_tkn_itm_.Tid_newLine: // new_line found; anything afterwards is a \s or a \t; SEE.WIKT:coincidence
nl_lhs = i;
i = -1; // gobble new line, else para runs on to next; ISSUE#:437 DATE:2019-04-27
break;
default:
i = -1;

View File

@ -16,7 +16,7 @@ Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
package gplx.xowa.parsers.miscs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
import org.junit.*;
public class Xop_comm_lxr_tst {
private final Xop_fxt fxt = new Xop_fxt();
private final Xop_fxt fxt = new Xop_fxt();
@Test public void Basic() {
fxt.Test_parse_page_all_str("a<!-- b -->c", "ac");
}
@ -97,4 +97,21 @@ public class Xop_comm_lxr_tst {
));
fxt.Init_para_n_();
}
@Test public void Comment_should_not_gobble_paras() {// ISSUE#:437 DATE:2019-04-27
fxt.Init_para_y_();
fxt.Test_parse_page_all_str(String_.Concat_lines_nl_skip_last
( "a"
, ""
, "<!-- z --> "
, "b"
), String_.Concat_lines_nl_skip_last // was <p>a\nb\<p>
( "<p>a"
, "</p>"
, ""
, "<p>b"
, "</p>"
, ""
));
fxt.Init_para_n_();
}
}