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

Html: Replace underscores with spaces in subpages [#308]

This commit is contained in:
gnosygnu 2018-12-23 21:49:57 -05:00
parent 43ec6a8163
commit 54ad1d697d
2 changed files with 12 additions and 1 deletions

View File

@ -47,7 +47,10 @@ public class Xoh_subpages_bldr implements gplx.core.brys.Bfr_arg {
byte[] seg_ttl = ttl_bfr.To_bry();
byte[] seg_ttl_enc = gplx.langs.htmls.encoders.Gfo_url_encoder_.Href.Encode(ttl_bfr.To_bry());
byte[] href = Bry_.Add(Xoh_href_.Bry__wiki, seg_ttl_enc); // EX: /wiki/Help:A
fmtr_itm.Bld_bfr(bfr, dlm, href, seg_ttl, seg);
fmtr_itm.Bld_bfr(bfr, dlm, href
// NOTE: convert underscore to space; ISSUE#:308 PAGE:en.v:Computer-aided_design/Software DATE:2018-12-23
, Xoa_ttl.Replace_unders(seg_ttl)
, Xoa_ttl.Replace_unders(seg));
}
ttl_bfr.Clear();
}

View File

@ -25,6 +25,14 @@ public class Xoh_subpages_bldr_tst {
, "</span>"
));
}
@Test public void Underscore_space() {// PURPOSE: convert underscore to space; ISSUE#:308 PAGE:en.v:Computer-aided_design/Software DATE:2018-12-23
fxt.Test_bld("Help:A_1/B_1/C_1", String_.Concat_lines_nl_skip_last
( "<span class=\"subpages\">"
, " &lt; <a href=\"/wiki/Help:A_1\" title=\"Help:A 1\">Help:A 1</a>"
, " &lrm; | <a href=\"/wiki/Help:A_1/B_1\" title=\"Help:A 1/B 1\">B 1</a>"
, "</span>"
));
}
@Test public void Skip_page() {
fxt.Wiki().Ns_mgr().Add_new(104, "Page");
fxt.Wiki().Ns_mgr().Ns_page_id_(104);