diff --git a/400_xowa/src/gplx/xowa/users/history/Xou_history_itm.java b/400_xowa/src/gplx/xowa/users/history/Xou_history_itm.java index bdedfa0f4..d89612177 100644 --- a/400_xowa/src/gplx/xowa/users/history/Xou_history_itm.java +++ b/400_xowa/src/gplx/xowa/users/history/Xou_history_itm.java @@ -20,6 +20,12 @@ import gplx.core.primitives.*; public class Xou_history_itm { private Xou_history_itm() {} public Xou_history_itm(byte[] wiki, byte[] page) { + // remove "\n" from page for Category b/c it breaks the csv_parser; DATE:2016-10-12 + int nl_pos = Bry_find_.Find_fwd(page, Byte_ascii.Nl); + if (nl_pos != Bry_find_.Not_found) { + page = Bry_.Mid(page, 0, nl_pos); + } + this.wiki = wiki; this.page = page; this.key = key_(wiki, page); diff --git a/400_xowa/src/gplx/xowa/users/history/Xou_history_mgr_tst.java b/400_xowa/src/gplx/xowa/users/history/Xou_history_mgr_tst.java index 2dff69cc6..f4aa4795b 100644 --- a/400_xowa/src/gplx/xowa/users/history/Xou_history_mgr_tst.java +++ b/400_xowa/src/gplx/xowa/users/history/Xou_history_mgr_tst.java @@ -42,6 +42,11 @@ public class Xou_history_mgr_tst { fxt.Add_one("Special:AllPages", "?from=A"); fxt.List_tst("Special:AllPages?from=A"); } + @Test public void Remove_nl() { + fxt.Clear(); + fxt.Add_many("Category:A?pagefrom=B\nB"); + fxt.List_tst("Category:A?pagefrom=B"); + } } class Xou_history_mgr_fxt { Xoae_app app; Xowe_wiki wiki;