Commit 0b532f27 authored by Alessandro Ghedini's avatar Alessandro Ghedini

Merge commit 'upstream/2.0.9'

parents 284eaab7 cf87eb68
......@@ -16,10 +16,11 @@ OBJS=mkdio.o markdown.o dumptree.o generate.o \
resource.o docheader.o version.o toc.o css.o \
xml.o Csio.o xmlpage.o basename.o emmatch.o \
setup.o tags.o html5.o flags.o @AMALLOC@
TESTFRAMEWORK=echo cols
MAN3PAGES=mkd-callbacks.3 mkd-functions.3 markdown.3 mkd-line.3
all: $(PGMS) $(SAMPLE_PGMS)
all: $(PGMS) $(SAMPLE_PGMS) $(TESTFRAMEWORK)
install: $(PGMS)
@INSTALL_PROGRAM@ $(PGMS) $(DESTDIR)/$(BINDIR)
......@@ -78,7 +79,7 @@ $(MKDLIB): $(OBJS)
verify: echo tools/checkbits.sh
@./echo -n "headers ... "; tools/checkbits.sh && echo "GOOD"
test: $(PGMS) echo cols verify
test: $(PGMS) $(TESTFRAMEWORK) verify
@for x in tests/*.t; do \
@LD_LIBRARY_PATH@=`pwd` sh $$x || exit 1; \
done
......@@ -89,7 +90,7 @@ echo: tools/echo.c config.h
$(CC) -o echo tools/echo.c
clean:
rm -f $(PGMS) $(SAMPLE_PGMS) *.o
rm -f $(PGMS) $(TESTFRAMEWORK) $(SAMPLE_PGMS) *.o
rm -f $(MKDLIB) `./librarian.sh files $(MKDLIB) VERSION`
distclean spotless: clean
......
......@@ -879,29 +879,29 @@ char **argv;
EOF
rc=1
LOGN "defining WORD & DWORD scalar types"
if $AC_CC /tmp/pd$$.c -o /tmp/pd$$; then
if $AC_CC /tmp/pd$$.c -o $__cwd/pd$$; then
while [ "$1" ]; do
case "$1" in
sub)if /tmp/pd$$ sub >> $__cwd/config.sub; then
sub)if $__cwd/pd$$ sub >> $__cwd/config.sub; then
rc=0
fi;;
*) if /tmp/pd$$ >> $__cwd/config.h; then
*) if $__cwd/pd$$ >> $__cwd/config.h; then
rc=0
fi ;;
esac
shift
done
if [ "$rc" != 0 ]; then
if /tmp/pd$$ >> $__cwd/config.h; then
if $__cwd/pd$$ >> $__cwd/config.h; then
rc=1
fi
fi
fi
rm -f $__cwd/pd$$ /tmp/pd$$.c
case "$rc" in
0) TLOG "" ;;
*) AC_FAIL " ** FAILED **" ;;
esac
rm -f /tmp/pd$$ /tmp/pd$$.c
}
......@@ -1151,8 +1151,8 @@ main()
}
EOF
if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $LIBS; then
if /tmp/ngc$$; then
if $AC_CC -o $__cwd/ngc$$ /tmp/ngc$$.c $LIBS; then
if $__cwd/ngc$$; then
TLOG "(found)"
AC_DEFINE 'HAVE_BASENAME' 1
AC_CHECK_HEADERS libgen.h
......@@ -1162,7 +1162,7 @@ EOF
else
TLOG "(not found)"
fi
rm -f /tmp/ngc$$ /tmp/ngc$$.c
rm -f $__cwd/ngc$$ /tmp/ngc$$.c
}
#
......
......@@ -39,35 +39,36 @@ char *pgm = "markdown";
static struct _opt {
char *name;
char *desc;
int off;
int skip;
int off:1;
int skip:1;
int sayenable:1;
mkd_flag_t flag;
} opts[] = {
{ "tabstop", "default (4-space) tabstops", 0, 0, MKD_TABSTOP },
{ "image", "images", 1, 0, MKD_NOIMAGE },
{ "links", "links", 1, 0, MKD_NOLINKS },
{ "relax", "emphasis inside words", 1, 1, MKD_STRICT },
{ "strict", "emphasis inside words", 0, 0, MKD_STRICT },
{ "tables", "tables", 1, 0, MKD_NOTABLES },
{ "header", "pandoc-style headers", 1, 0, MKD_NOHEADER },
{ "html", "html", 1, 0, MKD_NOHTML },
{ "ext", "extended protocols", 1, 0, MKD_NO_EXT },
{ "cdata", "generate cdata", 0, 0, MKD_CDATA },
{ "smarty", "smartypants", 1, 0, MKD_NOPANTS },
{ "pants", "smartypants", 1, 1, MKD_NOPANTS },
{ "toc", "tables of contents", 0, 0, MKD_TOC },
{ "autolink", "autolinking", 0, 0, MKD_AUTOLINK },
{ "safelink", "safe links", 0, 0, MKD_SAFELINK },
{ "strikethrough", "strikethrough", 1, 0, MKD_NOSTRIKETHROUGH },
{ "del", "strikethrough", 1, 1, MKD_NOSTRIKETHROUGH },
{ "superscript", "superscript", 1, 0, MKD_NOSUPERSCRIPT },
{ "emphasis", "emphasis inside words", 0, 0, MKD_NORELAXED },
{ "divquote", ">%class% blockquotes", 1, 0, MKD_NODIVQUOTE },
{ "alphalist", "alpha lists", 1, 0, MKD_NOALPHALIST },
{ "definitionlist","definition lists", 1, 0, MKD_NODLIST },
{ "1.0", "markdown 1.0 compatability", 0, 0, MKD_1_COMPAT },
{ "footnotes", "markdown extra footnotes", 0, 0, MKD_EXTRA_FOOTNOTE },
{ "footnote", "markdown extra footnotes", 0, 1, MKD_EXTRA_FOOTNOTE },
{ "tabstop", "default (4-space) tabstops", 0, 0, 1, MKD_TABSTOP },
{ "image", "images", 1, 0, 1, MKD_NOIMAGE },
{ "links", "links", 1, 0, 1, MKD_NOLINKS },
{ "relax", "emphasis inside words", 1, 1, 1, MKD_STRICT },
{ "strict", "emphasis inside words", 0, 0, 1, MKD_STRICT },
{ "tables", "tables", 1, 0, 1, MKD_NOTABLES },
{ "header", "pandoc-style headers", 1, 0, 1, MKD_NOHEADER },
{ "html", "raw html", 1, 0, 1, MKD_NOHTML },
{ "ext", "extended protocols", 1, 0, 1, MKD_NO_EXT },
{ "cdata", "generate cdata", 0, 0, 0, MKD_CDATA },
{ "smarty", "smartypants", 1, 0, 1, MKD_NOPANTS },
{ "pants", "smartypants", 1, 1, 1, MKD_NOPANTS },
{ "toc", "tables of contents", 0, 0, 1, MKD_TOC },
{ "autolink", "autolinking", 0, 0, 1, MKD_AUTOLINK },
{ "safelink", "safe links", 0, 0, 1, MKD_SAFELINK },
{ "strikethrough", "strikethrough", 1, 0, 1, MKD_NOSTRIKETHROUGH },
{ "del", "strikethrough", 1, 1, 1, MKD_NOSTRIKETHROUGH },
{ "superscript", "superscript", 1, 0, 1, MKD_NOSUPERSCRIPT },
{ "emphasis", "emphasis inside words", 0, 0, 1, MKD_NORELAXED },
{ "divquote", ">%class% blockquotes", 1, 0, 1, MKD_NODIVQUOTE },
{ "alphalist", "alpha lists", 1, 0, 1, MKD_NOALPHALIST },
{ "definitionlist","definition lists", 1, 0, 1, MKD_NODLIST },
{ "1.0", "markdown 1.0 compatibility", 0, 0, 1, MKD_1_COMPAT },
{ "footnotes", "markdown extra footnotes", 0, 0, 1, MKD_EXTRA_FOOTNOTE },
{ "footnote", "markdown extra footnotes", 0, 1, 1, MKD_EXTRA_FOOTNOTE },
} ;
#define NR(x) (sizeof x / sizeof x[0])
......@@ -104,7 +105,8 @@ show_flags(int byname)
for (i=0; i < NR(opts); i++)
if ( ! opts[i].skip ) {
fprintf(stderr, "%08lx : ", (long)opts[i].flag);
fprintf(stderr, opts[i].off ? "disable " : "enable ");
if ( opts[i].sayenable )
fprintf(stderr, opts[i].off ? "disable " : "enable ");
fprintf(stderr, "%s\n", opts[i].desc);
}
}
......
......@@ -228,7 +228,7 @@ mkd_string_to_anchor(char *s, int len, mkd_sta_function_t outchar,
size = mkd_line(s, len, &line, IS_LABEL);
if ( labelformat && size && !isalpha(line[0]) )
if ( labelformat && (size>0) && !isalpha(line[0]) )
(*outchar)('L',out);
for ( i=0; i < size ; i++ ) {
c = line[i];
......
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