+ikiwiki (3.20180311) upstream; urgency=medium
+
+ [ Amitai Schleier ]
+ * Avoid unexpected full paths from find(1)
+
+ [ thm.id.fedoraproject.org ]
+ * rst test: Probe for docutils Python 3 module, not Python 2
+
+ [ Simon McVittie ]
+ * mdwn: Automatically detect which Discount flags to use, fixing
+ regressions in 3.20180228 when using Discount < 2.2
+ * Add a test asserting that no plugin is an empty file, to confirm
+ that the build fixes in 3.20180228 were successful
+
+ -- Simon McVittie <smcv@debian.org> Sun, 11 Mar 2018 15:53:34 +0000
+
ikiwiki (3.20180228) upstream; urgency=medium
* core: Don't send relative redirect URLs when behind a reverse proxy
(! exists $config{nodiscount} || ! $config{nodiscount})) {
eval q{use Text::Markdown::Discount};
if (! $@) {
+ my $markdown = \&Text::Markdown::Discount::markdown;
+ my $always_flags = 0;
+
+ # Disable Pandoc-style % Title, % Author, % Date
+ # Use the meta plugin instead
+ $always_flags |= Text::Markdown::Discount::MKD_NOHEADER();
+
+ # Disable Unicodification of quote marks, em dashes...
+ # Use the typography plugin instead
+ $always_flags |= Text::Markdown::Discount::MKD_NOPANTS();
+
+ # Workaround for discount's eliding of <style> blocks.
+ # https://rt.cpan.org/Ticket/Display.html?id=74016
+ if (Text::Markdown::Discount->can('MKD_NOSTYLE')) {
+ $always_flags |= Text::Markdown::Discount::MKD_NOSTYLE();
+ }
+ elsif ($markdown->('<style>x</style>', 0) !~ '<style>' &&
+ $markdown->('<style>x</style>', 0x00400000) =~ m{<style>x</style>}) {
+ $always_flags |= 0x00400000;
+ }
+
+ # Enable fenced code blocks in libmarkdown >= 2.2.0
+ # https://bugs.debian.org/888055
+ if (Text::Markdown::Discount->can('MKD_FENCEDCODE')) {
+ $always_flags |= Text::Markdown::Discount::MKD_FENCEDCODE();
+ }
+ elsif ($markdown->("~~~\nx\n~~~", 0) !~ m{<pre\b} &&
+ $markdown->("~~~\nx\n~~~", 0x02000000) =~ m{<pre\b}) {
+ $always_flags |= 0x02000000;
+ }
+
+ # PHP Markdown Extra-style term\n: definition -> <dl>
+ if (Text::Markdown::Discount->can('MKD_DLEXTRA')) {
+ $always_flags |= Text::Markdown::Discount::MKD_DLEXTRA();
+ }
+ elsif ($markdown->("term\n: def\n", 0) !~ m{<dl>} &&
+ $markdown->("term\n: def\n", 0x01000000) =~ m{<dl>}) {
+ $always_flags |= 0x01000000;
+ }
+
+ # Allow dashes and underscores in tag names
+ if (Text::Markdown::Discount->can('MKD_GITHUBTAGS')) {
+ $always_flags |= Text::Markdown::Discount::MKD_GITHUBTAGS();
+ }
+ elsif ($markdown->('<foo_bar>', 0) !~ m{<foo_bar} &&
+ $markdown->('<foo_bar>', 0x08000000) =~ m{<foo_bar\b}) {
+ $always_flags |= 0x08000000;
+ }
+
$markdown_sub=sub {
my $t=shift;
# https://rt.cpan.org/Ticket/Display.html?id=73657
return "" if $t=~/^\s*$/;
- my $flags=0;
-
- # Disable Pandoc-style % Title, % Author, % Date
- # Use the meta plugin instead
- $flags |= Text::Markdown::Discount::MKD_NOHEADER();
-
- # Disable Unicodification of quote marks, em dashes...
- # Use the typography plugin instead
- $flags |= Text::Markdown::Discount::MKD_NOPANTS();
+ my $flags=$always_flags;
if ($config{mdwn_footnotes}) {
$flags |= Text::Markdown::Discount::MKD_EXTRA_FOOTNOTE();
$flags |= Text::Markdown::Discount::MKD_NOALPHALIST();
}
- # Workaround for discount's eliding
- # of <style> blocks.
- # https://rt.cpan.org/Ticket/Display.html?id=74016
- if (Text::Markdown::Discount->can("MKD_NOSTYLE")) {
- $flags |= Text::Markdown::Discount::MKD_NOSTYLE();
- }
- else {
- # This is correct for the libmarkdown.so.2 ABI
- $flags |= 0x00400000;
- }
-
- # Enable fenced code blocks in libmarkdown >= 2.2.0
- # https://bugs.debian.org/888055
- if (Text::Markdown::Discount->can("MKD_FENCEDCODE")) {
- $flags |= Text::Markdown::Discount::MKD_FENCEDCODE();
- }
- else {
- $flags |= 0x02000000;
- }
-
- # PHP Markdown Extra-style term\n: definition -> <dl>
- if (Text::Markdown::Discount->can("MKD_DLEXTRA")) {
- $flags |= Text::Markdown::Discount::MKD_DLEXTRA();
- }
- else {
- $flags |= 0x01000000;
- }
-
- # Allow dashes and underscores in tag names
- if (Text::Markdown::Discount->can("MKD_GITHUBTAGS")) {
- $flags |= Text::Markdown::Discount::MKD_GITHUBTAGS();
- }
- else {
- $flags |= 0x08000000;
- }
-
return Text::Markdown::Discount::markdown($t, $flags);
}
}
underlay_install:
install -d $(DESTDIR)$(PREFIX)/share/ikiwiki
set -e; \
- for dir in `cd underlays && $(FIND) . -follow -type d`; do \
+ for dir in `$(FIND) underlays -follow -mindepth 1 -type d | $(SED) -e 's|^underlays/||'`; do \
install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
for file in `$(FIND) underlays/$$dir -follow -maxdepth 1 -type f ! -name jquery.js ! -name jquery-ui.css ! -name jquery-ui.js ! -name jquery.tmpl.js`; do \
if ! cp -pRL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir 2>/dev/null; then \
extra_install: underlay_install
# Install example sites.
set -e; \
- for dir in `cd doc/examples; $(FIND) . -type d ! -regex '.*discussion.*'`; do \
+ for dir in `$(FIND) doc/examples -type d ! -regex '.*discussion.*' | $(SED) -e 's|^doc/examples/||'`; do \
install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$dir; \
done
set -e; \
- for file in `cd doc/examples; $(FIND) . -type f ! -regex '.*discussion.*'`; do \
+ for file in `$(FIND) doc/examples -type f ! -regex '.*discussion.*' | $(SED) -e 's|^doc/examples/||'`; do \
if ! cp -pRL doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file 2>/dev/null; then \
install -m 644 doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file; \
fi; \
cover -delete
$(MAKE) test PERL5OPT=-MDevel::Cover PERL5LIB=. TEST_FILES="$(filter-out t/git.t t/mercurial.t,$(wildcard t/*.t))"
cover
+
+git-dist:
+ git archive --format=tar --prefix=IkiWiki-$(VER)/ HEAD | xz -c > IkiWiki-$(VER).tar.xz
}
}
--- /dev/null
+# What I did
+
+Upgraded from 3.20180105 to 3.20180228 (from pkgsrc).
+No change to installed Text::Markdown::Discount (0.11nb4 from pkgsrc, using upstream's bundled Discount library).
+
+# What I expected to happen
+
+Markdown-style links to continue being rendered as before.
+
+# What actually happened
+
+Markdown-style links stopped being links.
+Instead, they render the part in square brackets as ordinary text.
+
+# Proximate cause
+
+In [f46e429](http://source.ikiwiki.branchable.com/?p=source.git;a=commitdiff;h=f46e429d96ead32943cb2670d7686df8c77de361), if I comment out the `MKD_GITHUBTAGS` if block, the problem goes away.
+
+# Further causes and possible solutions
+
+Some guesses:
+
+- Sufficiently old versions of the Discount library may break when passed unrecognized flags, in which case ikiwiki might want to version-check before passing flags
+- The version of the Discount library bundled with upstream Text::Markdown::Discount may be extremely old, in which case pkgsrc might want to make it depend instead on an external Discount package
+
+> This appears to be because `MKD_GITHUBTAGS` and `MKD_LATEX` both have numeric values that
+> were previously used for the internal flag `IS_LABEL`, which strips HTML (its value has
+> changed a couple of times).
+>
+> Having thought about this a bit, I realise I can probe for the values of these flags by
+> processing HTML that should have different results with the flag set or unset, which
+> would be safer than just blindly using them.
+>
+> Orthogonally, pkgsrc should probably use an up-to-date version of Discount, and
+> [we already know that Text::Markdown::Discount needs updating](https://rt.cpan.org/Public/Bug/Display.html?id=124188).
+> --[[smcv]]
+
+>> This should be [[fixed|done]] in current git. The mdwn module now
+>> detects what your version of Discount supports by trying several
+>> short HTML fragments that render differently under the different
+>> flags. --[[smcv]]
--- /dev/null
+Now that the rst plugin uses Python3, the test should test docutils existence also with Python3:
+
+ --- rst.t.orig 2018-02-28 10:41:06.000000000 +0000
+ +++ rst.t 2018-03-03 17:17:23.862702468 +0000
+ @@ -3,7 +3,7 @@
+ use strict;
+
+ BEGIN {
+ - if (system("python -c 'import docutils.core'") != 0) {
+ + if (system("python3 -c 'import docutils.core'") != 0) {
+ eval 'use Test::More skip_all => "docutils not available"';
+ }
+ }
+
+> [[Applied|done]], thanks. --[[smcv]]
* [Salient Dream](http://www.salientdream.com/) - All Things Strange.
* [Anton Berezin's blog](http://blog.tobez.org/)
* [Waldgarten]( http://waldgarten.greenonion.org/ ) News and documentation of a permaculture inspired neighbourhood-garden located in Hamburg, Germany.
+* [Frohdo](https://frohdo.de) - With raw food against back pain and other diseases
* [[OscarMorante]]'s [personal site](http://oscar.morante.eu).
* [Puckspage]( http://www.puckspage.org/ ) Political and personal blog in German. The name comes from the elf out of midsummer nights dream.
* [[LucaCapello]]'s [homepage](http://luca.pca.it)
+++ /dev/null
-ikiwiki 3.20170110 released with [[!toggle text="these changes"]]
-[[!toggleable text="""
- * [ Amitai Schleier ]
- * wrappers: Correctly escape quotes in git\_wrapper\_background\_command
- * [ Simon McVittie ]
- * git: use an explicit function parameter for the directory to work
- in. Previously, we used global state that was not restored correctly
- on catching exceptions, causing an unintended log message
- "cannot chdir to .../ikiwiki-temp-working: No such file or directory"
- with versions >= 3.20161229 when an attempt to revert a change fails
- or is disallowed
- * git: don't run "git rev-list ... -- -- ..." which would select the
- wrong commits if a file named literally "--" is present in the
- repository
- * check\_canchange: log "bad file name whatever", not literal string
- "bad file name %s"
- * t/git-cgi.t: fix a race condition that made the test fail
- intermittently
- * t/git-cgi.t: be more careful to provide a syntactically valid
- author/committer name and email, hopefully fixing this test on
- ci.debian.net
- * templates, comments, passwordauth: use rel=nofollow microformat
- for dynamic URLs
- * templates: use rel=nofollow microformat for comment authors
- * news: use Debian security tracker instead of MITRE for security
- references. Thanks, anarcat
- * Set package format to 3.0 (native)
- * d/copyright: re-order to put more specific stanzas later, to get the
- intended interpretation
- * d/source/lintian-overrides: override obsolete-url-in-packaging for
- OpenID Selector, which does not seem to have any more current URL
- (and in any case our version is a fork)
- * docwiki.setup: exclude TourBusStop from offline documentation.
- It does not make much sense there.
- * d/ikiwiki.lintian-overrides: override script-not-executable warnings
- * d/ikiwiki.lintian-overrides: silence false positive spelling warning
- for Moin Moin
- * d/ikiwiki.doc-base: register the documentation with doc-base
- * d/control: set libmagickcore-6.q16-3-extra as preferred
- build-dependency, with virtual package libmagickcore-extra as an
- alternative, to help autopkgtest to do the right thing"""]]
\ No newline at end of file
--- /dev/null
+ikiwiki 3.20180228 released with [[!toggle text="these changes"]]
+[[!toggleable text="""
+ * core: Don't send relative redirect URLs when behind a reverse proxy
+ * core: Escape backticks etc. in directive error messages as HTML
+ entities so that the error message is not subsequently parsed as
+ Markdown
+ * mdwn: Enable fenced code blocks, PHP Markdown Extra-style definition
+ lists and GitHub-style extensions to HTML tag syntax when used with
+ Discount >= 2.2.0 (Closes: #[888055](http://bugs.debian.org/888055))
+ * img: Fix auto-detection of image format (if enabled, which is
+ strongly discouraged) with ImageMagick >= 6.9.8-3
+ * rst: Use Python 3 instead of Python 2
+ * build: `set -e` before each `for` loop, so that errors are reliably
+ trapped
+ * build: Use if/then instead of `||` so that the `-e` flag works
+ * build: Ensure that pm\_to\_blib finishes before rewriting shebang lines
+ * t: Make the img test pass with ImageMagick >= 6.9.8-3
+ (Closes: #[891647](http://bugs.debian.org/891647))
+ * debian: Remove unused Lintian overrides for duplicate word false positives
+ * debian: Declare compliance with Debian Policy 4.1.3"""]]
\ No newline at end of file
Name: ikiwiki
-Version: 3.20180228
+Version: 3.20180311
Release: 1%{?dist}
Summary: A wiki compiler
# Underlay translation via po files that go in special per-language
# underlays.
- for file in `cd underlays && find . -type f -name \*.po`; do \
+ for file in `find underlays -type f -name \*.po | sed -e 's|^underlays/||'`; do \
lang=`echo $$file | sed -e 's/.po$$//' -e 's/.*\\.//'`; \
dir=`dirname "$(DESTDIR)$(PREFIX)/share/ikiwiki/po/$$lang/$$file"`; \
install -d $$dir; \
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-02-28 10:40+0000\n"
+"POT-Creation-Date: 2018-03-11 15:54+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "multimarkdown is enabled, but Text::MultiMarkdown is not installed"
msgstr ""
-#: ../IkiWiki/Plugin/mdwn.pm:175
+#: ../IkiWiki/Plugin/mdwn.pm:180
#, perl-format
msgid "failed to load Markdown.pm perl module (%s) or /usr/bin/markdown (%s)"
msgstr ""
%config=IkiWiki::defaultconfig();
$config{srcdir}=$config{destdir}="/dev/null";
+$config{disable_plugins}=["htmlscrubber"];
IkiWiki::loadplugins();
IkiWiki::checkconfig();
"This works[^1]\n\n[^1]: Sometimes it doesn't.\n"),
qr{<p>This works<sup\W}, "footnotes can be enabled");
+SKIP: {
+ skip 'set $IKIWIKI_TEST_ASSUME_MODERN_DISCOUNT if you have Discount 2.2.0+', 4
+ unless $ENV{IKIWIKI_TEST_ASSUME_MODERN_DISCOUNT};
+ like(IkiWiki::htmlize("foo", "foo", "mdwn",
+ "Definition list\n: A useful HTML structure\n"),
+ qr{<dl>.*<dt>Definition list</dt>\s*<dd>A useful HTML structure</dd>}s,
+ "definition lists are enabled by default");
+ like(IkiWiki::htmlize("foo", "foo", "mdwn",
+ "```\n#!/bin/sh\n```\n"),
+ qr{<pre>\s*<code>\s*[#]!/bin/sh\s*</code>\s*</pre>}s,
+ "code blocks are enabled by default");
+ like(IkiWiki::htmlize("foo", "foo", "mdwn",
+ "<foo_bar>"),
+ qr{<foo_bar>},
+ "GitHub tag name extensions are enabled by default");
+ like(IkiWiki::htmlize("foo", "foo", "mdwn",
+ "<style>foo</style>"),
+ qr{<style>foo</style>},
+ "Styles are not stripped by default");
+}
+
done_testing();
--- /dev/null
+#!/usr/bin/perl
+# Regression test for a weird build issue where wikitext.pm was installed
+# as an empty file, possibly caused by parallel builds. This was hopefully
+# fixed by making the build steps more robust in 3.20180228.
+# https://buildd.debian.org/status/fetch.php?pkg=ikiwiki&arch=all&ver=3.20180105-1&stamp=1515285462&raw=0
+# -rw-r--r-- root/root 0 2018-01-06 23:20 ./usr/share/perl5/IkiWiki/Plugin/wikitext.pm
+use warnings;
+use strict;
+use Cwd qw(getcwd);
+use File::Find qw(find);
+use Test::More;
+
+my @libs="IkiWiki.pm";
+
+if ($ENV{INSTALLED_TESTS}) {
+ foreach my $libdir (@INC) {
+ my $wanted = sub {
+ return unless /\.pm$/;
+ my $name = $File::Find::name;
+ if ($name =~ s{^\Q$libdir/\E}{}) {
+ push @libs, $name;
+ }
+ };
+
+ if (-e "$libdir/IkiWiki.pm" && -d "$libdir/IkiWiki") {
+ find($wanted, "$libdir/IkiWiki");
+ last;
+ }
+ }
+}
+else {
+ my $cwd = getcwd;
+ my $wanted = sub {
+ return unless /\.pm$/;
+ my $name = $File::Find::name;
+ if ($name =~ s{^\Q$cwd/\E}{}) {
+ push @libs, $name;
+ }
+ };
+ find($wanted, "$cwd/IkiWiki");
+}
+
+plan(tests => scalar @libs);
+
+FILE: foreach my $file (@libs) {
+ foreach my $libdir (@INC) {
+ if (-e "$libdir/$file") {
+ ok(-s "$libdir/$file", "$file available in $libdir and not truncated");
+ next FILE;
+ }
+ }
+ fail("$file not available in ".join(':', @INC));
+}
use strict;
BEGIN {
- if (system("python -c 'import docutils.core'") != 0) {
+ if (system("python3 -c 'import docutils.core'") != 0) {
eval 'use Test::More skip_all => "docutils not available"';
}
}