Skip to content

Commit

Permalink
lib/parser: Add missing closing div tag (OSGeo#2523)
Browse files Browse the repository at this point in the history
End of file is being added both in parser and also in mkhtml because it is removed so that documentation can be just appended. This marks the closing tag with a comment so that the right line is removed.

(An ultimate solution is moving to more template-like replacement instead of the current file append.)
  • Loading branch information
wenzeslaus authored and neteler committed Nov 7, 2023
1 parent d07b539 commit 4d9a6e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/Make/HtmlRules.make
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# common html rules (included by Html.make and GuiScript.make)

htmldesc = $(call run_grass,$(1) --html-description < /dev/null | grep -v '</body>\|</html>' > $(2))
htmldesc = $(call run_grass,$(1) --html-description < /dev/null | grep -v '</body>\|</html>\|</div> <!-- end container -->' > $(2))

IMGSRC := $(wildcard *.png) $(wildcard *.jpg) $(wildcard *.gif)
IMGDST := $(patsubst %,$(HTMLDIR)/%,$(IMGSRC))
Expand Down
1 change: 1 addition & 0 deletions lib/gis/parser_html.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ void G__usage_html(void)
}
fprintf(stdout, "</div>\n");

fprintf(stdout, "</div> <!-- end container -->\n");
fprintf(stdout, "</body>\n</html>\n");
}

Expand Down
5 changes: 4 additions & 1 deletion utils/mkhtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,10 @@ def get_addon_path():
sys.stdout.write(header_tmpl.substitute(PGM=pgm, PGM_DESC=pgm_desc))
if tmp_data:
for line in tmp_data.splitlines(True):
if not re.search("</body>|</html>", line, re.IGNORECASE):
# The cleanup happens on Makefile level too.
if not re.search(
"</body>|</html>|</div> <!-- end container -->", line, re.IGNORECASE
):
sys.stdout.write(line)

# create TOC
Expand Down

0 comments on commit 4d9a6e6

Please sign in to comment.