Pages: Do not escape <pages> if invalid attributes [#656]

staging
gnosygnu 4 years ago
parent af337493af
commit bc2beba148

@ -44,6 +44,11 @@ public class Pp_pages_nde implements Xox_xnde, Mwh_atr_itm_owner1 {
unknown_xatrs.Add(new Pp_index_arg(xatr.Key_bry(), xatr.Val_as_bry()));
return;
}
// skip valid xatrs with invalid values; EX: <pages index=\"A\" from=1 to 2 />; ISSUE#:656 DATE:2020-01-19
if (xatr.Val_bgn() == -1)
return;
Byte_obj_val xatr_id = (Byte_obj_val)xatr_id_obj;
byte[] val_bry = xatr.Val_as_bry();
switch (xatr_id.Val()) {

@ -165,4 +165,14 @@ public class Pp_pages_nde_basic_tst {
, "</p>"
));
}
@Test public void Ignore_invalid_to() { // ISSUE#:656 DATE:2020-01-19
fxt.Init_page_create("Page:A/1", "A");
fxt.Init_page_create("Page:A/2", "B");
fxt.Init_page_create("Page:A/3", "C");
fxt.Test_parse_page_wiki_str("<pages index=\"A\" from=1 to 3 />", String_.Concat_lines_nl
( "<p>A&#32;B&#32;C&#32;" // fails if &lt;pages index=&quot;A&quot; from=1 to 3 /&gt;
, "</p>"
, ""
));
}
}

Loading…
Cancel
Save