[GRASS-dev] doc bug #411: quoting <> in html pages

Hamish hamish_nospam at yahoo.com
Thu May 31 02:49:23 EDT 2007


Hi,

re bug 411
http://wald.intevation.org/tracker/?func=detail&atid=207&aid=411&group_id=21



Any <> chars used in module option descriptions are broken when
converted into html docs.

Daniel pointed out that parser.c has print_escaped_for_xml() for this.

but....

lib/gis/parser.c  G_usage_html()


if (opt->description) {
	fprintf(stdout, "<DD>");
	newbuf = G_str_replace(opt->description, "\n","<br>");
	if (newbuf) {
	print_escaped_for_xml(stdout, newbuf);
		G_free(newbuf);
	} else
	print_escaped_for_xml(stdout, opt->description);
	fprintf(stdout, "</DD>\n");
}


print_escaped_for_xml() reformats the <BR>s which were inserted by
G_str_replace() into "&lt;BR&gt;". :(


any ideas? Use G_tokenize() with '\n' as the field sep?


Hamish




More information about the grass-dev mailing list