1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Section_edit: Add parse / intermediate html form

This commit is contained in:
gnosygnu
2016-12-03 10:49:33 -05:00
parent 5eaaae0749
commit 496068e9aa
14 changed files with 226 additions and 32 deletions

View File

@@ -24,7 +24,7 @@ public class Xoh_hdr_html {
private final Bry_bfr hdr_text_bfr = Bry_bfr_.New();
private final Xoh_toc_itm invalid_toc_itm = new Xoh_toc_itm().Set__txt(Bry_.Empty, Bry_.Empty);
private final Bry_fmt section_editable_fmt = Bry_fmt.Auto_nl_apos
( "<span class='mw-editsection'><span class='mw-editsection-bracket'>[</span><a href='/wiki/~{page_ttl}&action=edit&section=~{section_idx}' title='Edit section: ~{section_name}'>edit</a><span class='mw-editsection-bracket'>]</span></span>"
( "<span class='mw-editsection'><span class='mw-editsection-bracket'>[</span><a href='/wiki/~{page_ttl}?action=edit&section=~{section_idx}' title='Edit section: ~{section_name}'>edit</a><span class='mw-editsection-bracket'>]</span></span>"
);
public void Write_html(Bry_bfr bfr, Xoh_html_wtr wtr, Xowe_wiki wiki, Xoae_page page, Xop_ctx ctx, Xoh_wtr_ctx hctx, Xoh_html_wtr_cfg cfg, Xop_tkn_grp grp, int sub_idx, byte[] src, Xop_hdr_tkn hdr) {
@@ -66,13 +66,13 @@ public class Xoh_hdr_html {
if (hdr.Manual_end() > 0) bfr.Add_byte_repeat(Byte_ascii.Eq, hdr.Manual_end()); // '='
if (cfg.Toc__show())
bfr.Add(Gfh_tag_.Span_rhs); // '</span>'
bfr.Add(Bry__hdr_rhs_bgn).Add_int(hdr_num, 1, 1); // '</h', '2'
bfr.Add(Bry__hdr_rhs_end); // '>\n'
// write section editable
if (cfg.Section_editable()) {
if (cfg.Section_editable())
section_editable_fmt.Bld_many(bfr, hdr.Section_editable_page(), hdr.Section_editable_idx(), toc_itm.Anch());
}
bfr.Add(Bry__hdr_rhs_bgn).Add_int(hdr_num, 1, 1); // '</h', '2'
bfr.Add(Bry__hdr_rhs_end); // '>\n'
}
}