From 8c81ae0363a045f864a9c185d7744074cd4807ec Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 14 Apr 2017 12:25:10 -0700 Subject: [PATCH] doc/rdsrc: make sure HTML tags are properly closed The last file wouldn't necessarily close all the tags. Sigh. Signed-off-by: H. Peter Anvin --- doc/rdsrc.pl | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/rdsrc.pl b/doc/rdsrc.pl index c79ac2e2..b31d9b7e 100644 --- a/doc/rdsrc.pl +++ b/doc/rdsrc.pl @@ -818,7 +818,7 @@ sub write_html { $pflags =~ /chap (.*) :(.*)/; $title = "Chapter $1: "; $xref = $2; - print "\n\n"; select STDOUT; close TEXT; + &html_postamble; select STDOUT; close TEXT; $html_nav_last = $chapternode; $chapternode = $nodexrefs{$xref}; $html_nav_next = $tstruct_mnext{$chapternode}; @@ -836,7 +836,7 @@ sub write_html { $pflags =~ /appn (.*) :(.*)/; $title = "Appendix $1: "; $xref = $2; - print "\n\n"; select STDOUT; close TEXT; + &html_postamble; select STDOUT; close TEXT; $html_nav_last = $chapternode; $chapternode = $nodexrefs{$xref}; $html_nav_next = $tstruct_mnext{$chapternode}; @@ -924,10 +924,10 @@ sub write_html { } # Close whichever file was open. - &html_jumppoints; - print "\n"; - select STDOUT; - close TEXT; + print "\n" if ($in_code); + print "\n\n" if ($in_list); + print "\n" if ($in_bquo); + &html_postamble; select STDOUT; close TEXT; print "\n writing index file..."; open TEXT, '>', File::Spec->catfile($out_path, 'nasmdoci.html'); @@ -951,11 +951,8 @@ sub html_preamble { print "\n"; print "\n"; print "\n"; - &html_jumppoints; - print "

", $metadata{'title'}, "

\n\n"; -} -sub html_jumppoints { + # Navigation bar print "\n"; + + print "

", $metadata{'title'}, "

\n"; +} + +sub html_postamble { + # Closing tags + print "\n\n"; } sub html_index { -- 2.11.4.GIT