Hello community, here is the log from the commit of package discount for openSUSE:Factory checked in at 2015-05-26 12:33:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/discount (Old) and /work/SRC/openSUSE:Factory/.discount.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "discount" Changes: -------- --- /work/SRC/openSUSE:Factory/discount/discount.changes 2013-05-16 09:51:08.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.discount.new/discount.changes 2015-05-26 12:33:24.000000000 +0200 @@ -1,0 +2,91 @@ +Thu May 21 11:59:36 UTC 2015 - [email protected] + +- add symlink with update-alternatives to un-conflict Markdown.pl + +------------------------------------------------------------------- +Thu Apr 30 20:29:35 UTC 2015 - [email protected] + +- add build condition "fenced_code" to conditionally run configure + with "--with-fenced-code" + Building with this condition enables PHP markdown extra-style fenced code + sections, where your chunks of code are surrounded by ~~~ lines instead + of being indented 4 spaces. + +------------------------------------------------------------------- +Thu Apr 30 13:01:27 UTC 2015 - [email protected] + +- update to 2.1.8a +- correct license in spec file. It's actually BSD-3-Clause +- added patch for fixing some comiler warnings: + discount-fix-compile-warings.diff +- ran spec-cleaner and specfile cleanup + +- change from version 2.1.8a + When I put in the patch to ... + * Change the mail demangler to a debian-specific ‘always mangle one way’ hack. + (enabled with the configure.sh option –debian-glitch) + I messed up the format string and made the mangled email address into a fixed + bogus string. Sigh. Fixed (thanks to a patch from Alessandro Ghedini), updated + (and I really have to expand the runtime configuration flags array to be long + enough to fit 64 settings, but that’s a fix for a different day) and released. + +- change from version 2.1.8 + After a year or so of letting the code sit and slowly accumulate fixes, a new + version which fixes a wad of bugs and adds a few new features. Some of this + code is front other people, and those changes will be marked with their names: + + * FINALLY address the bug where markdown extra-style footnotes lose numbering + when they show up in nested element; I was not carrying the m-e reference# + inside the footnotes structure, but was instead carrying it in the parent + structure and not updating it. So I changed the footnotes structure to + include the reference + the list of footnotes, which made the misnumbering + go away on my tests. + * Fix makefile distclean to cleanup all the generated files and corrected the + names of the installed sample program man pages to end in .1 + (Mark Pizzolato [email protected]) + * Change the mail demangler to a debian-specific ‘always mangle one way’ hack. + (enabled with the configure.sh option –debian-glitch) + * Add –with-unmangled-email compile-time flag to disable mailto: mangling + * Allow the magic output filename -, which means send output to stdout instead + of to a file. + * Fix a bug where autolink + github flavored markdown absorbs the ^C eoln + character into a link at the end of a line. + * Tweak install.samples so that the user can supply a SAMPLE_PFX on the + command line SAMPLE_PFX=discount- make install.samples to install the sample + programs with a package-specific prefix. + * Emit pages in utf-8 instead of us-ascii (simply a change to the + Content-Type meta) (Nathan Phillip Brink [email protected]) + * Patch the horrible list handler to support long numeric list items + (George Hartzell [email protected]) + * Various bugfixes (Masayoshi Sekimura [email protected]) + * Fix support for CFLAGS=-m32 ./configure.sh by using CFLAGS for all build + invokations of CC. (Nathan Phillip Brink [email protected]) + * Github-style language attributes on fenced code blocks + (Loren Segal [email protected]) + * When defining WORD & DWORD, check first for the MS Windows WinDef.h file; + if found, include it instead of defining WORD & DWORD ourselves. + * support url-encoded anchor links with –with-urlencoded-anchor option + (Daisuke Murase [email protected]) + +- change from version 2.1.6 + does nothing except for some bugfixes (and ignores some particularly scary + ones that I /must/ fix soon) and adds two small features. + + * A < at the end of the input is exactly the same as \<(space) + * Markdown.pl does not appear to escape \<[nonwhite] sequences. Sigh. + * Tweak the previous Markdown does not escape... commit to simply push out + the backslash and back up to the start of the <[nonwhite] sequence, + so -fnohtml will continue to work. + * Treat hard <br/> (via two spaces) as whitespace. + * Tweak divquote handling so that two adjacent divquotes won’t die if there + is a space between the second > & leading % + * Tweak one of the list tests back to the previous behavior (I’ve put in a + hack for list indentation, and accidentally committed the changes. Oops!) + + The features are that I now use styles for table cell alignment instead of + align=, and that I’m using the 3-clause BSD license for this release + (because there is one widely used closed-source license that claims that you + can’t dynamically link with code that uses the 4-clause license. Fine. + I’ll 3-clause this release to make the stupid GPL happy.) + +------------------------------------------------------------------- Old: ---- discount-2.1.5a.tar.bz2 New: ---- discount-2.1.8a.tar.bz2 discount-fix-compile-warings.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ discount.spec ++++++ --- /var/tmp/diff_new_pack.hilhfA/_old 2015-05-26 12:33:25.000000000 +0200 +++ /var/tmp/diff_new_pack.hilhfA/_new 2015-05-26 12:33:25.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package discount # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,24 +16,28 @@ # +%bcond_with fenced_code +%define soname 2 + Name: discount -Version: 2.1.5a +Version: 2.1.8a Release: 0 -%define soname 2 Summary: Markdown text to HTML converter -License: BSD-4-Clause +License: BSD-3-Clause Group: Productivity/Text/Convertors +Url: http://www.pell.portland.or.us/~orc/Code/discount/ Source: http://www.pell.portland.or.us/~orc/Code/discount/discount-%{version}.tar.bz2 Patch1: discount-disable_ldconfig.patch -Url: http://www.pell.portland.or.us/~orc/Code/discount/ -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Patch2: discount-fix-compile-warings.diff BuildRequires: autoconf BuildRequires: automake +BuildRequires: fdupes BuildRequires: gcc BuildRequires: glibc-devel BuildRequires: libtool BuildRequires: make Requires: libmarkdown%{soname} = %{version} +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Discount is an implementation of John Gruber’s Markdown text to HTML language @@ -62,34 +66,52 @@ %prep %setup -q %patch1 +%patch2 -p1 %build -CC="%__cc" \ +CC="gcc" \ CFLAGS="%{optflags}" \ ./configure.sh \ + --shared \ --prefix="%{_prefix}" \ --execdir="%{_bindir}" \ --confdir="%{_sysconfdir}" \ --libdir="%{_libdir}" \ --mandir="%{_mandir}" \ - --enable-all-features \ - --shared \ - --with-dl=BOTH +%if %{with fenced_code} + --with-fenced-code \ +%endif + --with-dl=BOTH \ + --enable-all-features -%__make %{?jobs:-j%{jobs}} +make %{?_smp_mflags} %install -%__install -d "%{buildroot}%{_bindir}" -%__install -d "%{buildroot}%{_mandir}" -%__install -d "%{buildroot}%{_libdir}" -%__install -d "%{buildroot}%{_includedir}" +install -d "%{buildroot}%{_bindir}" +install -d "%{buildroot}%{_mandir}" +install -d "%{buildroot}%{_libdir}" +install -d "%{buildroot}%{_includedir}" -%__make \ - DESTDIR="%{buildroot}" \ +make \ + DESTDIR=%{buildroot} \ install.everything -%clean -%{?buildroot:%__rm -rf "%{buildroot}"} +%fdupes %{buildroot}%{_mandir}/man3 + +# update-alternatives +mv %{buildroot}%{_bindir}/markdown %{buildroot}%{_bindir}/discount-markdown +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +touch %{buildroot}%{_sysconfdir}/alternatives/markdown +ln -sf %{_sysconfdir}/alternatives/markdown %{buildroot}%{_bindir}/markdown + +%post +update-alternatives \ + --install %{_bindir}/markdown markdown %{_bindir}/discount-markdown 20 + +%postun +if [ $1 -eq 0 ] ; then + update-alternatives --remove markdown %{_bindir}/discount-markdown +fi %post -n libmarkdown%{soname} -p /sbin/ldconfig %postun -n libmarkdown%{soname} -p /sbin/ldconfig @@ -99,11 +121,13 @@ %doc COPYRIGHT CREDITS README %{_bindir}/makepage %{_bindir}/markdown +%{_bindir}/discount-markdown +%ghost %{_sysconfdir}/alternatives/markdown %{_bindir}/mkd2html %{_bindir}/theme -%doc %{_mandir}/man1/*.1%{ext_man} -%doc %{_mandir}/man7/markdown.7%{ext_man} -%doc %{_mandir}/man7/mkd-extensions.7%{ext_man} +%{_mandir}/man1/*.1%{ext_man} +%{_mandir}/man7/markdown.7%{ext_man} +%{_mandir}/man7/mkd-extensions.7%{ext_man} %files -n libmarkdown%{soname} %defattr(-,root,root) ++++++ discount-2.1.5a.tar.bz2 -> discount-2.1.8a.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/COPYRIGHT new/discount-2.1.8a/COPYRIGHT --- old/discount-2.1.5a/COPYRIGHT 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/COPYRIGHT 2015-04-17 22:49:06.000000000 +0200 @@ -1,47 +1,30 @@ ->Copyright (C) 2007 David Loren Parsons. All rights reserved.<- -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation files -(the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicence, and/or sell copies of the Software, -and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of works must retain the original copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the original copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither my name (David L Parsons) nor the names of contributors to + this code may be used to endorse or promote products derived + from this work without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions, and the following disclaimer. - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution, and in the same place and form as other - copyright, license and disclaimer information. - - 3. The end-user documentation included with the redistribution, if - any, must include the following acknowledgment: - - This product includes software developed by - David Loren Parsons <http://www.pell.portland.or.us/~orc> - - in the same place and form as other third-party acknowledgments. - Alternately, this acknowledgment may appear in the software - itself, in the same form and location as other such third-party - acknowledgments. - - 4. Except as contained in this notice, the name of David Loren - Parsons shall not be used in advertising or otherwise to promote - the sale, use or other dealings in this Software without prior - written authorization from David Loren Parsons. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL DAVID LOREN PARSONS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/CREDITS new/discount-2.1.8a/CREDITS --- old/discount-2.1.5a/CREDITS 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/CREDITS 2015-04-17 22:49:06.000000000 +0200 @@ -2,7 +2,7 @@ where it is via contributions, critiques, and bug reports from a host of other people, some of which are listed before. If your name isn't on this list, please remind me - -david parsons ([email protected]) + -david parsons ([email protected]) Josh Wood -- Plan9 support. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/INSTALL new/discount-2.1.8a/INSTALL --- old/discount-2.1.5a/INSTALL 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/INSTALL 2015-04-17 22:49:06.000000000 +0200 @@ -30,7 +30,6 @@ --enable-pandoc-header Use pandoc-style header blocks --enable-superscript A^B expands to A<sup>B</sup> --enable-amalloc Use a debugging memory allocator (to detect leaks) ---relaxed-emphasis Don't treat _ in the middle of a word as emphasis --with-tabstops=N Set tabstops to N characters (default is 4) 3) Installing sample programs and manpages diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/Makefile.in new/discount-2.1.8a/Makefile.in --- old/discount-2.1.5a/Makefile.in 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/Makefile.in 2015-04-17 22:49:06.000000000 +0200 @@ -31,9 +31,11 @@ install.everything: install install.samples install.man install.samples: $(SAMPLE_PGMS) install $(DESTDIR)$(BINDIR) - @INSTALL_PROGRAM@ $(SAMPLE_PGMS) $(DESTDIR)$(BINDIR) @INSTALL_DIR@ $(DESTDIR)$(MANDIR)/man1 - @INSTALL_DATA@ theme.1 makepage.1 mkd2html.1 $(DESTDIR)$(MANDIR)/man1 + for x in $(SAMPLE_PGMS); do \ + @INSTALL_PROGRAM@ $$x $(DESTDIR)$(BINDIR)/$(SAMPLE_PFX)$$x; \ + @INSTALL_DATA@ $$x.1 $(DESTDIR)$(MANDIR)/man1/$(SAMPLE_PFX)$$x.1; \ + done install.man: @INSTALL_DIR@ $(DESTDIR)$(MANDIR)/man3 @@ -64,7 +66,7 @@ @INSTALL_DIR@ $(DESTDIR)$(LIBDIR) version.o: version.c VERSION - $(CC) -DVERSION=\"`cat VERSION`\" -c version.c + $(CC) $(CFLAGS) -DVERSION=\"`cat VERSION`\" -c version.c VERSION: @true @@ -76,23 +78,23 @@ # example programs @THEME@theme: theme.o $(MKDLIB) mkdio.h -@THEME@ $(CC) $(LFLAGS) -o theme theme.o pgm_options.o -lmarkdown @LIBS@ +@THEME@ $(CC) $(CFLAGS) $(LFLAGS) -o theme theme.o pgm_options.o -lmarkdown @LIBS@ mkd2html: mkd2html.o $(MKDLIB) mkdio.h - $(CC) $(LFLAGS) -o mkd2html mkd2html.o -lmarkdown @LIBS@ + $(CC) $(CFLAGS) $(LFLAGS) -o mkd2html mkd2html.o -lmarkdown @LIBS@ markdown: main.o pgm_options.o $(MKDLIB) - $(CC) $(LFLAGS) -o markdown main.o pgm_options.o -lmarkdown @LIBS@ + $(CC) $(CFLAGS) $(LFLAGS) -o markdown main.o pgm_options.o -lmarkdown @LIBS@ makepage: makepage.c pgm_options.o $(MKDLIB) mkdio.h - $(CC) $(LFLAGS) -o makepage makepage.c pgm_options.o -lmarkdown @LIBS@ + $(CC) $(CFLAGS) $(LFLAGS) -o makepage makepage.c pgm_options.o -lmarkdown @LIBS@ pgm_options.o: pgm_options.c mkdio.h config.h - $(CC) -I. -c pgm_options.c + $(CC) $(CFLAGS) -I. -c pgm_options.c main.o: main.c mkdio.h config.h - $(CC) -I. -c main.c + $(CC) $(CFLAGS) -I. -c main.c $(MKDLIB): $(OBJS) ./librarian.sh make $(MKDLIB) VERSION $(OBJS) @@ -115,7 +117,7 @@ rm -f $(MKDLIB) `./librarian.sh files $(MKDLIB) VERSION` distclean spotless: clean - rm -f @GENERATED_FILES@ @CONFIGURE_FILES@ + rm -f @GENERATED_FILES@ @CONFIGURE_FILES@ ./mktags ./blocktags ./librarian.sh Csio.o: Csio.c cstring.h amalloc.h config.h markdown.h amalloc.o: amalloc.c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/README new/discount-2.1.8a/README --- old/discount-2.1.5a/README 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/README 2015-04-17 22:49:06.000000000 +0200 @@ -5,7 +5,7 @@ and passes the Markdown test suite at <http://daringfireball.net/projects/downloads/MarkdownTest_1.0.zip> -DISCOUNT is free software written by David Parsons <[email protected]>; +DISCOUNT is free software written by David Parsons <[email protected]>; it is released under a BSD-style license that allows you to do as you wish with it as long as you don't attempt to claim it as your own work. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/VERSION new/discount-2.1.8a/VERSION --- old/discount-2.1.5a/VERSION 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/VERSION 2015-04-17 22:49:06.000000000 +0200 @@ -1 +1 @@ -2.1.5a +2.1.8a diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/configure.inc new/discount-2.1.8a/configure.inc --- old/discount-2.1.5a/configure.inc 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/configure.inc 2015-04-17 22:49:06.000000000 +0200 @@ -868,6 +868,18 @@ # AC_SCALAR_TYPES checks to see if the compiler can generate 2 and 4 byte ints. # AC_SCALAR_TYPES () { + + rc=1 + LOGN "defining WORD & DWORD scalar types" + + if AC_QUIET AC_CHECK_HEADERS WinDef.h; then + # windows machine; BYTE, WORD, DWORD already + # defined + echo "#include <WinDef.h>" >> $__cwd/config.h + TLOG " (defined in WinDef.h)" + return 0 + fi + cat > ngc$$.c << EOF #include <stdio.h> #include <string.h> @@ -908,8 +920,6 @@ exit(0); } EOF - rc=1 - LOGN "defining WORD & DWORD scalar types" if $AC_CC ngc$$.c -o ngc$$; then while [ "$1" ]; do case "$1" in @@ -933,6 +943,7 @@ 0) TLOG "" ;; *) AC_FAIL " ** FAILED **" ;; esac + return $rc } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/configure.sh new/discount-2.1.8a/configure.sh --- old/discount-2.1.5a/configure.sh 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/configure.sh 2015-04-17 22:49:06.000000000 +0200 @@ -13,6 +13,7 @@ --with-id-anchor Use id= anchors for table-of-contents links --with-github-tags Allow `_` and `-` in <> tags --with-fenced-code Allow fenced code blocks +--with-urlencoded-anchor Use url-encoded chars to multibyte chars in toc links --enable-all-features Turn on all stable optional features --shared Build shared libraries (default is static)' @@ -36,6 +37,9 @@ ;; --ENABLE-*) enable=`echo $K | sed -e 's/--ENABLE-//' | tr '-' '_'` echo WITH_${enable}=T ;; + --DEBIAN-GLITCH) + echo DEBIAN_GLITCH=T + ;; esac } @@ -57,6 +61,8 @@ test "$WITH_FENCED_CODE" && AC_DEFINE "WITH_FENCED_CODE" 1 test "$WITH_ID_ANCHOR" && AC_DEFINE 'WITH_ID_ANCHOR' 1 test "$WITH_GITHUB_TAGS" && AC_DEFINE 'WITH_GITHUB_TAGS' 1 +test "$WITH_URLENCODED_ANCHOR" && AC_DEFINE 'WITH_URLENCODED_ANCHOR' 1 +test "$DEBIAN_GLITCH" && AC_DEFINE 'DEBIAN_GLITCH' 1 AC_PROG_CC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/emmatch.c new/discount-2.1.8a/emmatch.c --- old/discount-2.1.5a/emmatch.c 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/emmatch.c 2015-04-17 22:49:06.000000000 +0200 @@ -22,7 +22,7 @@ * of html has been generated. * * It should create MarkdownTest_1.0 (and _1.0.3) - * compatable emphasis for non-pathological cases + * compatible emphasis for non-pathological cases * and it should fail in a standards-compliant way * when someone attempts to feed it junk. * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/generate.c new/discount-2.1.8a/generate.c --- old/discount-2.1.5a/generate.c 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/generate.c 2015-04-17 22:49:06.000000000 +0200 @@ -38,6 +38,16 @@ } +/* + * push a character into the generator input buffer + */ +static void +pushc(char c, MMIOT *f) +{ + EXPAND(f->in) = c; +} + + /* look <i> characters ahead of the cursor. */ static inline int @@ -73,7 +83,11 @@ { int c = peek(f, i); - return isspace(c) || (c == EOF); + if ( c == EOF ) + return 1; + if ( c & 0x80 ) + return 0; + return isspace(c) || (c < ' '); } @@ -203,7 +217,7 @@ sub.esc = f->esc; push(bfr, size, &sub); - EXPAND(sub.in) = 0; + pushc(0, &sub); S(sub.in)--; text(&sub); @@ -258,7 +272,7 @@ Qstring("%22", f); else if ( isalnum(c) || ispunct(c) || (display && isspace(c)) ) Qchar(c, f); - else if ( c == 003 ) /* untokenize ^C */ + else if ( c == MKD_EOLN ) /* untokenize hard return */ Qstring(" ", f); else Qprintf(f, "%%%02X", c); @@ -614,7 +628,7 @@ ___mkd_reparse(T(text), S(text), linkt.flags, f, 0); else { ref->flags |= REFERENCED; - ref->refnumber = ++ f->reference; + ref->refnumber = ++ f->footnotes->reference; Qprintf(f, "<sup id=\"%sref:%d\"><a href=\"#%s:%d\" rel=\"footnote\">%d</a></sup>", p_or_nothing(f), ref->refnumber, p_or_nothing(f), ref->refnumber, ref->refnumber); @@ -727,8 +741,9 @@ S(key.tag) = S(name); } - if ( ref = bsearch(&key, T(*f->footnotes), S(*f->footnotes), - sizeof key, (stfu)__mkd_footsort) ) { + if ( ref = bsearch(&key, T(f->footnotes->note), + S(f->footnotes->note), + sizeof key, (stfu)__mkd_footsort) ) { if ( extra_footnote ) status = extra_linky(f,name,ref); else @@ -770,8 +785,12 @@ mangle(char *s, int len, MMIOT *f) { while ( len-- > 0 ) { +#if DEBIAN_GLITCH + Qprintf(f, "&#%02d;", *((unsigned char*)(s++)) ); +#else Qstring("&#", f); Qprintf(f, COINTOSS() ? "x%02x;" : "%02d;", *((unsigned char*)(s++)) ); +#endif } } @@ -833,7 +852,7 @@ int i,c; for ( i=0; i < length; i++ ) - if ( (c = s[i]) == 003) /* ^C: expand back to 2 spaces */ + if ( (c = s[i]) == MKD_EOLN) /* ^C: expand back to 2 spaces */ Qstring(" ", f); else if ( c == '\\' && (i < length-1) && escaped(f, s[i+1]) ) cputc(s[++i], f); @@ -1040,13 +1059,14 @@ /* greedily scan forward for the end of a legitimate link. */ - for ( size=0; (c=peek(f, size+1)) != EOF; size++ ) + for ( size=0; (c=peek(f, size+1)) != EOF; size++ ) { if ( c == '\\' ) { if ( peek(f, size+2) != EOF ) ++size; } - else if ( isspace(c) || strchr("'\"()[]{}<>`", c) ) + else if ( isspace(c) || strchr("'\"()[]{}<>`", c) || c == MKD_EOLN ) break; + } if ( (size > 1) && process_possible_link(f, size) ) { shift(f, size); @@ -1239,7 +1259,8 @@ switch (c) { case 0: break; - case 3: Qstring(tag_text(f) ? " " : "<br/>", f); + case MKD_EOLN: + Qstring(tag_text(f) ? " " : "<br/>", f); break; case '>': if ( tag_text(f) ) @@ -1335,7 +1356,16 @@ case '\\': switch ( c = pull(f) ) { case '&': Qstring("&", f); break; - case '<': Qstring("<", f); + case '<': c = peek(f,1); + if ( (c == EOF) || isspace(c) ) + Qstring("<", f); + else { + /* Markdown.pl does not escape <[nonwhite] + * sequences */ + Qchar('\\', f); + shift(f, -1); + } + break; case '^': if ( f->flags & (MKD_STRICT|MKD_NOSUPERSCRIPT) ) { Qchar('\\', f); @@ -1424,8 +1454,9 @@ enum e_alignments { a_NONE, a_CENTER, a_LEFT, a_RIGHT }; -static char* alignments[] = { "", " align=\"center\"", " align=\"left\"", - " align=\"right\"" }; +static char* alignments[] = { "", " style=\"text-align:center;\"", + " style=\"text-align:left;\"", + " style=\"text-align:right;\"" }; typedef STRING(int) Istring; @@ -1553,13 +1584,14 @@ && T(t->text)[S(t->text)-2] == ' ' && T(t->text)[S(t->text)-1] == ' ' ) { push(T(t->text), S(t->text)-2, f); - push("\003\n", 2, f); + pushc(MKD_EOLN, f); + pushc('\n', f); } else { ___mkd_tidy(&t->text); push(T(t->text), S(t->text), f); if ( t->next ) - push("\n", 1, f); + pushc('\n', f); } } t = t->next; @@ -1572,11 +1604,17 @@ static void -printcode(Line *t, MMIOT *f) +printcode(Line *t, char *lang, MMIOT *f) { int blanks; - Qstring("<pre><code>", f); + Qstring("<pre><code", f); + if (lang) { + Qstring(" class=\"", f); + Qstring(lang, f); + Qstring("\"", f); + } + Qstring(">", f); for ( blanks = 0; t ; t = t->next ) { if ( S(t->text) > t->dle ) { while ( blanks ) { @@ -1689,7 +1727,7 @@ break; case CODE: - printcode(p->text, f); + printcode(p->text, p->lang, f); break; case QUOTE: @@ -1738,14 +1776,14 @@ int j, i; Footnote *t; - if ( m->reference == 0 ) + if ( m->footnotes->reference == 0 ) return; Csprintf(&m->out, "\n<div class=\"footnotes\">\n<hr/>\n<ol>\n"); - for ( i=1; i <= m->reference; i++ ) { - for ( j=0; j < S(*m->footnotes); j++ ) { - t = &T(*m->footnotes)[j]; + for ( i=1; i <= m->footnotes->reference; i++ ) { + for ( j=0; j < S(m->footnotes->note); j++ ) { + t = &T(m->footnotes->note)[j]; if ( (t->refnumber == i) && (t->flags & REFERENCED) ) { Csprintf(&m->out, "<li id=\"%s:%d\">\n<p>", p_or_nothing(m), t->refnumber); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/main.c new/discount-2.1.8a/main.c --- old/discount-2.1.5a/main.c 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/main.c 2015-04-17 22:49:06.000000000 +0200 @@ -60,6 +60,7 @@ } +int main(int argc, char **argv) { int opt; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/makepage.1 new/discount-2.1.8a/makepage.1 --- old/discount-2.1.5a/makepage.1 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/makepage.1 2015-04-17 22:49:06.000000000 +0200 @@ -42,4 +42,4 @@ .Xr mkd-extensions 7 . .Sh AUTHOR .An David Parsons -.Pq Li [email protected] +.Pq Li [email protected] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/markdown.1 new/discount-2.1.8a/markdown.1 --- old/discount-2.1.5a/markdown.1 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/markdown.1 2015-04-17 22:49:06.000000000 +0200 @@ -176,4 +176,4 @@ .Xr mkd-extensions 7 . .Sh AUTHOR .An David Parsons -.Pq Li [email protected] +.Pq Li [email protected] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/markdown.c new/discount-2.1.8a/markdown.c --- old/discount-2.1.5a/markdown.c 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/markdown.c 2015-04-17 22:49:06.000000000 +0200 @@ -178,6 +178,14 @@ #define UNCHECK(l) ((l)->flags &= ~CHECKED) +#ifdef WITH_FENCED_CODE +# define UNLESS_FENCED(t) if (fenced) { \ + other = 1; l->count += (c == ' ' ? 0 : -1); \ + } else { t; } +#else +# define UNLESS_FENCED(t) t; +#endif + /* * walk a line, seeing if it's any of half a dozen interesting regular * types. @@ -188,8 +196,8 @@ int eol, i; int dashes = 0, spaces = 0, equals = 0, underscores = 0, - stars = 0, tildes = 0, - backticks = 0; + stars = 0, tildes = 0, other = 0, + backticks = 0, fenced = 0; l->flags |= CHECKED; l->kind = chk_text; @@ -206,16 +214,19 @@ if ( c != ' ' ) l->count++; switch (c) { - case '-': dashes = 1; break; - case ' ': spaces = 1; break; + case '-': UNLESS_FENCED(dashes = 1); break; + case ' ': UNLESS_FENCED(spaces = 1); break; case '=': equals = 1; break; - case '_': underscores = 1; break; + case '_': UNLESS_FENCED(underscores = 1); break; case '*': stars = 1; break; #if WITH_FENCED_CODE - case '~': tildes = 1; break; - case '`': backticks = 1; break; + case '~': if (other) return; fenced = 1; tildes = 1; break; + case '`': if (other) return; fenced = 1; backticks = 1; break; #endif - default: return; + default: + other = 1; + l->count--; + if (!fenced) return; } } @@ -524,7 +535,7 @@ strtoul(T(t->text)+t->dle, &q, 10); if ( (q > T(t->text)+t->dle) && (q == T(t->text) + (j-1)) ) { j = nextnonblank(t,j); - *clip = (j > 4) ? 4 : j; + *clip = j; *list_type = OL; return AL; } @@ -637,6 +648,14 @@ if ( iscodefence(r->next, first->count, first->kind) ) { (*ptr) = r->next->next; ret = Pp(d, first->next, CODE); + if (S(first->text) - first->count > 0) { + char *lang_attr = T(first->text) + first->count; + while ( *lang_attr != 0 && *lang_attr == ' ' ) lang_attr++; + ret->lang = strdup(lang_attr); + } + else { + ret->lang = 0; + } ___mkd_freeLine(first); ___mkd_freeLine(r->next); r->next = 0; @@ -729,6 +748,7 @@ if ( flags & (MKD_NODIVQUOTE|MKD_STRICT) ) return 0; + start = nextnonblank(p, start); last= S(p->text) - (1 + start); s = T(p->text) + start; @@ -831,6 +851,12 @@ UNCHECK(t); t->dle = mkd_firstnonblank(t); + /* even though we had to trim a long leader off this item, + * the indent for trailing paragraphs is still 4... + */ + if (indent > 4) { + indent = 4; + } if ( (q = skipempty(t->next)) == 0 ) { ___mkd_freeLineRange(t,q); return 0; @@ -982,7 +1008,7 @@ int c; Line *np = p->next; - Footnote *foot = &EXPAND(*f->footnotes); + Footnote *foot = &EXPAND(f->footnotes->note); CREATE(foot->tag); CREATE(foot->link); @@ -997,6 +1023,7 @@ j = nextnonblank(p, j+2); if ( (f->flags & MKD_EXTRA_FOOTNOTE) && (T(foot->tag)[0] == '^') ) { + /* need to consume all lines until non-indented block? */ while ( j < S(p->text) ) EXPAND(foot->title) = T(p->text)[j++]; goto skip_to_end; @@ -1304,13 +1331,14 @@ doc->ctx->flags = flags & USER_FLAGS; CREATE(doc->ctx->in); doc->ctx->footnotes = malloc(sizeof doc->ctx->footnotes[0]); - CREATE(*doc->ctx->footnotes); + doc->ctx->footnotes->reference = 0; + CREATE(doc->ctx->footnotes->note); mkd_initialize(); doc->code = compile_document(T(doc->content), doc->ctx); - qsort(T(*doc->ctx->footnotes), S(*doc->ctx->footnotes), - sizeof T(*doc->ctx->footnotes)[0], + qsort(T(doc->ctx->footnotes->note), S(doc->ctx->footnotes->note), + sizeof T(doc->ctx->footnotes->note)[0], (stfu)__mkd_footsort); memset(&doc->content, 0, sizeof doc->content); return 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/markdown.h new/discount-2.1.8a/markdown.h --- old/discount-2.1.5a/markdown.h 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/markdown.h 2015-04-17 22:49:06.000000000 +0200 @@ -49,6 +49,7 @@ struct paragraph *down; /* recompiled contents of this paragraph */ struct line *text; /* all the text in this paragraph */ char *ident; /* %id% tag for QUOTE */ + char *lang; /* lang attribute for CODE */ enum { WHITESPACE=0, CODE, QUOTE, MARKUP, HTML, STYLE, DL, UL, OL, AL, LISTITEM, HDR, HR, TABLE, SOURCE } typ; @@ -87,6 +88,12 @@ } ; +struct footnote_list { + int reference; + STRING(Footnote) note; +} ; + + /* a magic markdown io thing holds all the data structures needed to * do the backend processing of a markdown document */ @@ -95,10 +102,9 @@ Cstring in; Qblock Q; int isp; - int reference; struct escaped *esc; char *ref_prefix; - STRING(Footnote) *footnotes; + struct footnote_list *footnotes; DWORD flags; #define MKD_NOLINKS 0x00000001 #define MKD_NOIMAGE 0x00000002 @@ -131,6 +137,9 @@ } MMIOT; +#define MKD_EOLN 3 + + /* * the mkdio text input functions return a document structure, * which contains a header (retrieved from the document if diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/mkd-extensions.7 new/discount-2.1.8a/mkd-extensions.7 --- old/discount-2.1.5a/mkd-extensions.7 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/mkd-extensions.7 2015-04-17 22:49:06.000000000 +0200 @@ -111,14 +111,6 @@ .Pp Be warned that style blocks work like footnote links -- no matter where you define them they are valid for the entire document. -.Ss relaxed emphasis -The rules for emphasis are changed so that a single -.Ar _ -will -.Em not -count as a emphasis character if it's in the middle of a word. -This is primarily for documenting code, if you don't wish to -have to backquote all code references. .Ss alpha lists Alphabetic lists (like regular numeric lists, but with alphabetic items) are supported. So: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/mkd2html.1 new/discount-2.1.8a/mkd2html.1 --- old/discount-2.1.5a/mkd2html.1 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/mkd2html.1 2015-04-17 22:49:06.000000000 +0200 @@ -49,4 +49,4 @@ .Xr mkd-extensions 7 . .Sh AUTHOR .An David Parsons -.Pq Li [email protected] +.Pq Li [email protected] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/mkd2html.c new/discount-2.1.8a/mkd2html.c --- old/discount-2.1.5a/mkd2html.c 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/mkd2html.c 2015-04-17 22:49:06.000000000 +0200 @@ -81,7 +81,7 @@ CREATE(footers); pgm = basename(argv[0]); - while ( argc ) { + while ( argc > 1 ) { if ( strcmp(argv[1], "-css") == 0 ) { EXPAND(css) = argv[2]; argc -= 2; @@ -159,7 +159,7 @@ " <meta name=\"GENERATOR\" content=\"mkd2html %s\">\n", markdown_version); fprintf(output," <meta http-equiv=\"Content-Type\"\n" - " content=\"text/html; charset-us-ascii\">"); + " content=\"text/html; charset=utf-8\">"); for ( i=0; i < S(css); i++ ) fprintf(output, " <link rel=\"stylesheet\"\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/mkdio.c new/discount-2.1.8a/mkdio.c --- old/discount-2.1.5a/mkdio.c 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/mkdio.c 2015-04-17 22:49:06.000000000 +0200 @@ -215,6 +215,9 @@ mkd_string_to_anchor(char *s, int len, mkd_sta_function_t outchar, void *out, int labelformat) { +#if WITH_URLENCODED_ANCHOR + static const unsigned char hexchars[] = "0123456789abcdef"; +#endif unsigned char c; int i, size; @@ -222,15 +225,25 @@ size = mkd_line(s, len, &line, IS_LABEL); +#if !WITH_URLENCODED_ANCHOR if ( labelformat && (size>0) && !isalpha(line[0]) ) (*outchar)('L',out); +#endif for ( i=0; i < size ; i++ ) { c = line[i]; if ( labelformat ) { if ( isalnum(c) || (c == '_') || (c == ':') || (c == '-') || (c == '.' ) ) (*outchar)(c, out); else +#if WITH_URLENCODED_ANCHOR + { + (*outchar)('%', out); + (*outchar)(hexchars[c >> 4 & 0xf], out); + (*outchar)(hexchars[c & 0xf], out); + } +#else (*outchar)('.', out); +#endif } else (*outchar)(c,out); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/mkdio.h.in new/discount-2.1.8a/mkdio.h.in --- old/discount-2.1.5a/mkdio.h.in 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/mkdio.h.in 2015-04-17 22:49:06.000000000 +0200 @@ -26,7 +26,7 @@ /* compilation, debugging, cleanup */ int mkd_compile(MMIOT*, mkd_flag_t); -int mkd_cleanup(MMIOT*); +void mkd_cleanup(MMIOT*); /* markup functions */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/resource.c new/discount-2.1.8a/resource.c --- old/discount-2.1.5a/resource.c 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/resource.c 2015-04-17 22:49:06.000000000 +0200 @@ -51,6 +51,8 @@ ___mkd_freeLines(p->text); if (p->ident) free(p->ident); + if (p->lang) + free(p->lang); free(p); } @@ -74,9 +76,9 @@ int i; if ( f->footnotes ) { - for (i=0; i < S(*f->footnotes); i++) - ___mkd_freefootnote( &T(*f->footnotes)[i] ); - DELETE(*f->footnotes); + for (i=0; i < S(f->footnotes->note); i++) + ___mkd_freefootnote( &T(f->footnotes->note)[i] ); + DELETE(f->footnotes->note); free(f->footnotes); } } @@ -96,7 +98,7 @@ f->footnotes = footnotes; else { f->footnotes = malloc(sizeof f->footnotes[0]); - CREATE(*f->footnotes); + CREATE(f->footnotes->note); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/tags.c new/discount-2.1.8a/tags.c --- old/discount-2.1.5a/tags.c 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/tags.c 2015-04-17 22:49:06.000000000 +0200 @@ -26,6 +26,9 @@ * either the standard or extra tag tables. */ if ( !(p = mkd_search_tags(id, strlen(id))) ) { + /* extratags could be deallocated */ + if ( S(extratags) == 0 ) + CREATE(extratags); p = &EXPAND(extratags); p->id = id; p->size = strlen(id); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/tests/backslash.t new/discount-2.1.8a/tests/backslash.t --- old/discount-2.1.5a/tests/backslash.t 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/tests/backslash.t 2015-04-17 22:49:06.000000000 +0200 @@ -12,5 +12,10 @@ 'http://a.com/\' \ '<p><a href="http://a.com/\">http://a.com/\</a></p>' + +try 'backslashes before <text' '\<code>' '<p>\<code></p>' +try 'backslashes before <{EOF}' '\<' '<p><</p>' +try 'backslashes before <[space]' '\< j' '<p>< j</p>' + summary $0 exit $rc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/tests/code.t new/discount-2.1.8a/tests/code.t --- old/discount-2.1.5a/tests/code.t 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/tests/code.t 2015-04-17 22:49:06.000000000 +0200 @@ -33,6 +33,17 @@ if ./markdown -V | grep FENCED-CODE >/dev/null; then +try 'fenced code block with blank lines' \ +'~~~ +code! + +still code! +~~~' \ + '<pre><code>code! + +still code! +</code></pre>' + try 'fenced code block' \ '~~~ code! @@ -100,6 +111,55 @@ code ~~~</p>' +try 'fenced code block with lang attribute' \ +'```lang +code +```' \ +'<pre><code class="lang">code +</code></pre>' + +try 'fenced code block with lang-name attribute' \ +'```lang-name +code +```' \ +'<pre><code class="lang-name">code +</code></pre>' + +try 'fenced code block with lang_name attribute' \ +'```lang_name +code +```' \ +'<pre><code class="lang_name">code +</code></pre>' + +try 'fenced code block with lang attribute and space' \ +'``` lang +code +```' \ +'<pre><code class="lang">code +</code></pre>' + +try 'fenced code block with lang attribute and multiple spaces' \ +'``` lang +code +```' \ +'<pre><code class="lang">code +</code></pre>' + +try 'fenced code block with lang-name attribute and space' \ +'``` lang-name +code +```' \ +'<pre><code class="lang-name">code +</code></pre>' + +try 'fenced code block with lang_name attribute and space' \ +'``` lang_name +code +```' \ +'<pre><code class="lang_name">code +</code></pre>' + fi summary $0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/tests/defects.t new/discount-2.1.8a/tests/defects.t --- old/discount-2.1.5a/tests/defects.t 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/tests/defects.t 2015-04-17 22:49:06.000000000 +0200 @@ -13,5 +13,11 @@ <br> <span>bar</span><br></p>' +try -fautolink -G 'autolink + github-flavoured markdown' \ +'http://foo +bar' \ +'<p><a href="http://foo">http://foo</a><br/> +bar</p>' + summary $0 exit $rc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/tests/extrafootnotes.t new/discount-2.1.8a/tests/extrafootnotes.t --- old/discount-2.1.5a/tests/extrafootnotes.t 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/tests/extrafootnotes.t 2015-04-17 22:49:06.000000000 +0200 @@ -31,5 +31,90 @@ try -fnofootnote 'footnotes (-fnofootnote)' "$FOOTIE" \ '<p>I haz a footnote<a href="yes?">^1</a></p>' + +TSRC='Alpha[^AlphaF]. + +Column 1 | Column 2 +---------------------------------|-------------------------- +Beta[^BetaF] | cell + +[^AlphaF]: Alpha Footnote + +[^BetaF]: Beta Footnote' + +TOUT='<p>Alpha<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup>.</p> + +<table> +<thead> +<tr> +<th>Column 1 </th> +<th> Column 2</th> +</tr> +</thead> +<tbody> +<tr> +<td>Beta<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> </td> +<td> cell</td> +</tr> +</tbody> +</table> + +<div class="footnotes"> +<hr/> +<ol> +<li id="fn:1"> +<p>Alpha Footnote<a href="#fnref:1" rev="footnote">↩</a></p></li> +<li id="fn:2"> +<p>Beta Footnote<a href="#fnref:2" rev="footnote">↩</a></p></li> +</ol> +</div>' + +try -ffootnote 'footnotes inside table elements' "$TSRC" "$TOUT" + + +TSRC='[Test test[^test]](class:test) + +<span class="test"> +Test2[^testtwo] +</span> + +Test3[^testthree] + +<span class="test"> +Test4[^testfour] +</span> + +[^test]: Test footnote +[^testtwo]: Test2 footnote +[^testthree]: Test3 footnote +[^testfour]: Test4 footnote' + +TOUT='<p><span class="test">Test test<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></span></p> + +<p><span class="test"> +Test2<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> +</span></p> + +<p>Test3<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup></p> + +<p><span class="test"> +Test4<sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup> +</span></p> +<div class="footnotes"> +<hr/> +<ol> +<li id="fn:1"> +<p>Test footnote<a href="#fnref:1" rev="footnote">↩</a></p></li> +<li id="fn:2"> +<p>Test2 footnote<a href="#fnref:2" rev="footnote">↩</a></p></li> +<li id="fn:3"> +<p>Test3 footnote<a href="#fnref:3" rev="footnote">↩</a></p></li> +<li id="fn:4"> +<p>Test4 footnote<a href="#fnref:4" rev="footnote">↩</a></p></li> +</ol> +</div>' + +try -ffootnote 'footnotes inside spans' "$TSRC" "$TOUT" + summary $0 exit $rc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/tests/list.t new/discount-2.1.8a/tests/list.t --- old/discount-2.1.5a/tests/list.t 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/tests/list.t 2015-04-17 22:49:06.000000000 +0200 @@ -61,9 +61,9 @@ <li><p>A (list)</p> <ol> -<li> Sub (list)</li> -<li> Two (items)</li> -<li> Here</li> +<li>Sub (list)</li> +<li>Two (items)</li> +<li>Here</li> </ol> @@ -151,5 +151,46 @@ <dd>hi!</dd> </dl>' +try 'long enumerated list tag' \ + '10000. This is an item + + and this is another paragraph in the same + item. + +2. and this is another item. +' \ +'<ol> +<li><p>This is an item</p> + +<p>and this is another paragraph in the same +item.</p></li> +<li><p>and this is another item.</p></li> +</ol>' + +try 'long enumerated list tag' \ + '10000. This is an item + + and this is another paragraph in the same + item. + + 200000. A longer number in an embedded list. + 200001. Another longer and bigger number in an embedded list. + +2. and this is another item. +' \ +'<ol> +<li><p>This is an item</p> + +<p>and this is another paragraph in the same +item.</p> + +<ol> +<li>A longer number in an embedded list.</li> +<li>Another longer and bigger number in an embedded list.</li> +</ol> +</li> +<li><p>and this is another item.</p></li> +</ol>' + summary $0 exit $rc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/tests/tables.t new/discount-2.1.8a/tests/tables.t --- old/discount-2.1.5a/tests/tables.t 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/tests/tables.t 2015-04-17 22:49:06.000000000 +0200 @@ -97,14 +97,14 @@ '<table> <thead> <tr> -<th align="right">a </th> -<th align="left"> b</th> +<th style="text-align:right;">a </th> +<th style="text-align:left;"> b</th> </tr> </thead> <tbody> <tr> -<td align="right">hello</td> -<td align="left">sailor</td> +<td style="text-align:right;">hello</td> +<td style="text-align:left;">sailor</td> </tr> </tbody> </table>' @@ -257,16 +257,16 @@ '<table> <thead> <tr> -<th align="left">AA</th> -<th align="center">BB</th> -<th align="right">CC</th> +<th style="text-align:left;">AA</th> +<th style="text-align:center;">BB</th> +<th style="text-align:right;">CC</th> </tr> </thead> <tbody> <tr> -<td align="left">aa</td> -<td align="center">bb</td> -<td align="right">cc</td> +<td style="text-align:left;">aa</td> +<td style="text-align:center;">bb</td> +<td style="text-align:right;">cc</td> </tr> </tbody> </table>' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/theme.1 new/discount-2.1.8a/theme.1 --- old/discount-2.1.5a/theme.1 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/theme.1 2015-04-17 22:49:06.000000000 +0200 @@ -157,4 +157,4 @@ .Xr mkd-extensions 7 . .Sh AUTHOR .An David Parsons -.Pq Li [email protected] +.Pq Li [email protected] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discount-2.1.5a/theme.c new/discount-2.1.8a/theme.c --- old/discount-2.1.5a/theme.c 2012-08-09 05:37:52.000000000 +0200 +++ new/discount-2.1.8a/theme.c 2015-04-17 22:49:06.000000000 +0200 @@ -592,7 +592,7 @@ strcat(q, ".html"); } } - if ( output ) { + if ( output && strcmp(output, "-") ) { if ( force ) unlink(output); if ( !freopen(output, "w", stdout) ) ++++++ discount-fix-compile-warings.diff ++++++ diff --git a/Makefile.in b/Makefile.in index 6b88ebf..6d9609f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -108,9 +108,9 @@ test: $(PGMS) $(TESTFRAMEWORK) verify done cols: tools/cols.c config.h - $(CC) -o cols tools/cols.c + $(CC) $(CFLAGS) -o cols tools/cols.c echo: tools/echo.c config.h - $(CC) -o echo tools/echo.c + $(CC) $(CFLAGS) -o echo tools/echo.c clean: rm -f $(PGMS) $(TESTFRAMEWORK) $(SAMPLE_PGMS) *.o
