From 824cf7db1b96a16b080e284bc3ebf90c1f14a203 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 1 Dec 2018 21:18:23 +0000 Subject: po: Always filter .po files The input to filter hooks is meant to be the content of a source file on disk. If we only filter once per (page, destpage) pair, and a page is inlined into the same destpage more than once, then the second occurrence will render as the result of htmlizing .po source as if it was Markdown (or whatever the type of the corresponding master page is), which is never going to end well. The alreadyfiltered mechanism was added in commit 1e874b3f to avoid preprocessing loops, but I'm not sure where it could lead to a loop: filter hooks are only called from IkiWiki::filter, which is only called on page content from disk or on proposed content being previewed. According to , deleting the alreadyfiltered mechanism resolves the problem, as well as simplifying the code. Closes: #911356 Tested-by: intrigeri --- t/po.t | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 't') diff --git a/t/po.t b/t/po.t index 82f9e2078..ccb508bef 100755 --- a/t/po.t +++ b/t/po.t @@ -440,20 +440,6 @@ like($output{debian911356}, qr{

After\sinlines

}sx); -like($output{'debian911356.fr'}, qr{ -

Avant\sla\spremière\sinline

- \s* -

Contenu\sfrançais

- \s* -

Entre\sles\sinlines

- \s* - .* # TODO: This paragraph gets mangled (Debian #911356) - \s* -

Après\sles\sinlines

-}sx); - -TODO: { -local $TODO = "Debian bug #911356"; like($output{'debian911356.fr'}, qr{

Avant\sla\spremière\sinline

\s* @@ -465,7 +451,6 @@ like($output{'debian911356.fr'}, qr{ \s*

Après\sles\sinlines

}sx); -}; # Variation of Debian #911356 without using raw inlines. like($output{debian911356ish}, qr{ @@ -496,28 +481,6 @@ like($output{debian911356ish}, qr{

After\sinlines

}sx); -like($output{'debian911356ish.fr'}, qr{ -

Avant\sla\spremière\sinline

- \s* - - \s* - - \s* -
debian911356-inlined\.fr
- \s* -

Contenu\sfrançais

- \s* - - \s* -

Entre\sles\sinlines

- \s* - .* # TODO: This paragraph gets mangled (Debian #911356) - \s* -

Après\sles\sinlines

-}sx); - -TODO: { -local $TODO = "Debian bug #911356"; like($output{'debian911356ish.fr'}, qr{

Avant\sla\spremière\sinline

\s* @@ -545,6 +508,5 @@ like($output{'debian911356ish.fr'}, qr{ \s*

Après\sles\sinlines

}sx); -}; done_testing; -- cgit v1.2.3