mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Xtn.Pages: Do not escape XML in header previous / current / next links [#624]
This commit is contained in:
parent
9d8ab5d206
commit
520a73537f
@ -145,7 +145,8 @@ public class Pp_pages_nde implements Xox_xnde, Mwh_atr_itm_owner1 {
|
||||
private byte[] Get_caption(Bry_bfr full_bfr, byte[] index_page_src, Xop_lnki_tkn lnki) {
|
||||
byte[] rv = Bry_.Empty;
|
||||
try {
|
||||
wiki.Html_mgr().Html_wtr().Write_tkn_to_html(full_bfr, ctx, Xoh_wtr_ctx.Basic, index_page_src, null, -1, lnki.Caption_tkn());
|
||||
// NOTE: call "Lnki_wtr().Write_caption", not "Write_tkn_to_html" else XML in caption will be escaped; ISSUE#:624 DATE:2019-11-30
|
||||
wiki.Html_mgr().Html_wtr().Lnki_wtr().Write_caption(full_bfr, Xoh_wtr_ctx.Basic, index_page_src, lnki, lnki.Ttl());
|
||||
rv = full_bfr.To_bry_and_clear();
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
@ -231,4 +231,21 @@ public class Pp_pages_nde_index_tst {
|
||||
, "</p>"
|
||||
));
|
||||
}
|
||||
@Test public void Index__caption_w_xml() { // PURPOSE: do not escape XML in caption; ISSUE#:624 DATE:2019-11-30
|
||||
// create header page with just "prev" token
|
||||
fxt.Init_page_create("MediaWiki:Proofreadpage_header_template", "{{{prev}}}\n");
|
||||
|
||||
// create index page with 3 links: "current" page and flanking "prev" and "next" pages; note the xml in the caption
|
||||
fxt.Init_page_create("Index:A", String_.Concat_lines_nl
|
||||
( "[[Test_page_prev|<b>prev</b>]]"
|
||||
, "[[Test_page|<b>cur</b>]]"
|
||||
, "[[Test_page_next|<b>next</b>]]"
|
||||
));
|
||||
|
||||
// parse text; fails if "<b>prev</b>"
|
||||
fxt.Test_parse_page_wiki_str("<pages index='A' header=1 />", String_.Concat_lines_nl
|
||||
( "<p><a href=\"/wiki/Test_page_prev\"><b>prev</b></a>"
|
||||
, "</p>"
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user