Commit 6338dcca authored by Michael R Sweet's avatar Michael R Sweet

Escape HTML special characters inside @code foo@.

Use xcrun to run the docsetutil program.
parent d5af089c
CHANGES - 2011-12-20
CHANGES - 2013-07-03
--------------------
CHANGES IN Mini-XML 2.8
- Now call docsetutil using xcrun on OS X.
- mxmldoc did not escape special HTML characters inside @code foo@
comments.
CHANGES IN Mini-XML 2.7
- Added 64-bit configurations to the VC++ project files (STR #129)
......
......@@ -3,7 +3,7 @@
#
# Makefile for Mini-XML, a small XML-like file parsing library.
#
# Copyright 2003-2011 by Michael R Sweet.
# Copyright 2003-2013 by Michael R Sweet.
#
# These coded instructions, statements, and computer programs are the
# property of Michael R Sweet and are protected by Federal copyright
......@@ -396,7 +396,7 @@ mxml.xml: mxmldoc-static mxml.h $(PUBLIBOBJS:.o=.c)
--css doc/docset.css --title "Mini-XML API Reference" \
mxml.xml || exit 1; \
$(RM) org.minixml.atom; \
/Developer/usr/bin/docsetutil package --output org.minixml.xar \
xcrun docsetutil package --output org.minixml.xar \
--atom org.minixml.atom \
--download-url http://www.minixml.org/org.minixml.xar \
org.minixml.docset || exit 1; \
......
......@@ -5,7 +5,7 @@
* Documentation generator using Mini-XML, a small XML-like file parsing
* library.
*
* Copyright 2003-2011 by Michael R Sweet.
* Copyright 2003-2013 by Michael R Sweet.
*
* These coded instructions, statements, and computer programs are the
* property of Michael R Sweet and are protected by Federal copyright
......@@ -2824,7 +2824,21 @@ write_description(
ptr --;
if (element && *element)
fprintf(out, "<code>%s</code>", start);
{
fputs("<code>", out);
for (; *start; start ++)
{
if (*start == '<')
fputs("&lt;", out);
else if (*start == '>')
fputs("&gt;", out);
else if (*start == '&')
fputs("&amp;", out);
else
putc(*start, out);
}
fputs("</code>", out);
}
else if (element)
fputs(start, out);
else
......@@ -3778,15 +3792,17 @@ write_html(const char *section, /* I - Section */
if (docset)
{
const char *args[4]; /* Argument array */
int argc = 0; /* Argument count */
const char *args[5]; /* Argument array */
pid_t pid; /* Process ID */
int status; /* Exit status */
args[0] = "/Developer/usr/bin/docsetutil";
args[1] = "index";
args[2] = docset;
args[3] = NULL;
args[argc++] = "/usr/bin/xcrun";
args[argc++] = "docsetutil";
args[argc++] = "index";
args[argc++] = docset;
args[argc ] = NULL;
if (posix_spawn(&pid, args[0], NULL, NULL, (char **)args, environ))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment