Escape HTML special characters inside @code foo@.

Use xcrun to run the docsetutil program.
pull/193/head
Michael R Sweet 11 years ago
parent d5af089cc3
commit 6338dccaac
  1. 9
      CHANGES
  2. 4
      Makefile.in
  3. 30
      mxmldoc.c

@ -1,6 +1,13 @@
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))
{

Loading…
Cancel
Save