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:
parent
f895259be6
commit
4a1b2e25c0
@ -55,6 +55,7 @@ public class Xop_comm_lxr implements Xop_lxr {
|
|||||||
break;
|
break;
|
||||||
case Xop_tkn_itm_.Tid_newLine: // new_line found; anything afterwards is a \s or a \t; SEE.WIKT:coincidence
|
case Xop_tkn_itm_.Tid_newLine: // new_line found; anything afterwards is a \s or a \t; SEE.WIKT:coincidence
|
||||||
nl_lhs = i;
|
nl_lhs = i;
|
||||||
|
i = -1; // gobble new line, else para runs on to next; ISSUE#:437 DATE:2019-04-27
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
i = -1;
|
i = -1;
|
||||||
|
@ -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.*;
|
package gplx.xowa.parsers.miscs; import gplx.*; import gplx.xowa.*; import gplx.xowa.parsers.*;
|
||||||
import org.junit.*;
|
import org.junit.*;
|
||||||
public class Xop_comm_lxr_tst {
|
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() {
|
@Test public void Basic() {
|
||||||
fxt.Test_parse_page_all_str("a<!-- b -->c", "ac");
|
fxt.Test_parse_page_all_str("a<!-- b -->c", "ac");
|
||||||
}
|
}
|
||||||
@ -97,4 +97,21 @@ public class Xop_comm_lxr_tst {
|
|||||||
));
|
));
|
||||||
fxt.Init_para_n_();
|
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_();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user