From 69d0c932c7d4a2bc3ce65c9c6d6aa54b23e803c3 Mon Sep 17 00:00:00 2001 From: Rickard Green Date: Mon, 23 May 2016 14:56:05 +0200 Subject: Adjust generated XML so it respects current DTD --- make/emd2exml.in | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) (limited to 'make') diff --git a/make/emd2exml.in b/make/emd2exml.in index d84b967e40..903d707716 100644 --- a/make/emd2exml.in +++ b/make/emd2exml.in @@ -39,7 +39,7 @@ %%% Created : 25 Feb 2010 by Rickard Green %%%------------------------------------------------------------------- --define(MAX_HEADING, 3). +-define(MAX_HEADING, 6). -define(DELAYED_COPYRIGHT_IX, 0). -define(DELAYED_TOC_IX, 1). @@ -80,7 +80,6 @@ copyright = false, copyright_data = [], have_h1 = false, - smarker_ix = false, toc = [], ifile, ofile}). @@ -368,9 +367,9 @@ put_text(S, "%OTP-REL%"++Cs, CTag, EmTag, Acc) -> put_text(S, [$\\,C|Cs], no, EmTag, Acc) -> put_text(S, Cs, no, EmTag, [C|Acc]); put_text(S, [C,C|Cs], no, b, Acc) when C == $*; C == $_ -> - put_text(S, Cs, no, no, [""|Acc]); + put_text(S, Cs, no, no, [""|Acc]); put_text(S, [C,C|Cs], no, no, Acc) when C == $*; C == $_ -> - put_text(S, Cs, no, b, [""|Acc]); + put_text(S, Cs, no, b, [""|Acc]); put_text(S, [C|Cs], no, em, Acc) when C == $*; C == $_ -> put_text(S, Cs, no, no, [""|Acc]); put_text(S, [C|Cs], no, no, Acc) when C == $*; C == $_ -> @@ -614,8 +613,7 @@ strip_lvls(_N, Str) -> put_title(S, 1, Title) -> header(chk_h1(1, S#state{h = 1, mlist = [top]}), Title); put_title(#state{mlist = MList0, - toc = TOC, - smarker_ix = SMarkerIX} = S0, H, Title) -> + toc = TOC} = S0, H, Title) -> TitleStr = text(Title), MList1 = [mk_lvl_marker(Title) | MList0], Marker = mk_marker(MList1), @@ -626,12 +624,10 @@ put_title(#state{mlist = MList0, "", TitleStr,"",nl()], h = H, - mlist = MList1, - smarker_ix = false}), - true = is_integer(SMarkerIX), - S2 = write_delayed(S1, SMarkerIX, ["",nl()]), + mlist = MList1}), + S2 = put_chars(S1, ["",nl()]), {STag, ETag} = case H > ?MAX_HEADING of - true -> {"

", "

"}; + true -> {"

", "

"}; false -> {"", ""} end, put_chars(S2, [STag, TitleStr, ETag, nl()]). @@ -701,15 +697,10 @@ sections_change(H, OldH, #state{mlist = [_|ML], toc = TOC} = S0) -> begin_section(1, S) -> put_line(S, ""); -begin_section(H, #state{delayed_array_ix = IX} = S0) when H > ?MAX_HEADING -> - false = S0#state.smarker_ix, - true = is_integer(IX), - put_delayed(S0#state{smarker_ix = IX, delayed_array_ix = IX+1}, IX); -begin_section(H, #state{delayed_array_ix = IX} = S0) when H > 1 -> - false = S0#state.smarker_ix, - true = is_integer(IX), - S1 = put_delayed(S0#state{smarker_ix = IX, delayed_array_ix = IX+1}, IX), - put_line(S1, "
"); +begin_section(H, S) when H > ?MAX_HEADING -> + S; +begin_section(H, S0) when H > 1 -> + put_line(S0, "
"); begin_section(_H, S) -> S. @@ -779,7 +770,7 @@ create_toc(#state{toc = TOC} = S) -> {value,{"true",[]}} -> write_delayed(S, ?DELAYED_TOC_IX, - ["

Table of Contents

", nl(), TOC]); + ["

Table of Contents

", nl(), TOC]); _ -> write_delayed(S, ?DELAYED_TOC_IX, "") end. @@ -986,10 +977,10 @@ chg_bq_lvl(Lvl, #state{bq_lvl = Lvl} = S) -> S; chg_bq_lvl(NewLvl, #state{bq_lvl = Lvl} = S) when NewLvl > Lvl -> chg_bq_lvl(NewLvl, - put_line(end_p(end_code(S#state{bq_lvl = Lvl+1})), "
")); + put_line(end_p(end_code(S#state{bq_lvl = Lvl+1})), "")); chg_bq_lvl(NewLvl, #state{bq_lvl = Lvl} = S) -> chg_bq_lvl(NewLvl, - put_line(end_p(end_code(S#state{bq_lvl = Lvl-1})), "
")). + put_line(end_p(end_code(S#state{bq_lvl = Lvl-1})), "")). %% %% Resolve link -- cgit v1.2.3