01106: Separate diff rendering from history page rendering

Summary: Separate diff rendering from history page rendering
Created: 2009-07-06 19:39
Status: Closed - added for 2.2.11
Category: CoreCandidate
From: Diafygi
Assigned:
Priority: 443
Version: 2.2.2
OS: Ubuntu/Apache/PHP5

Description: Currently, PmWiki stores changes in the flat files as diffs. When it comes time to render those diffs into HTML, it has an algorithm that is inside the PrintDiff() function in pagerev.php.

However, if recipes want to render a page's changes for their own purposes (for example, ViewDiff), they have to basically copy the diff rendering algorithm from inside PrintDiff() and put it in their own recipe. This creates a problem if the core diff handling changes because there could be two ways of rendering diffs.

I propose a patch that removes the diff rendering algorithm from the PrintDiff() function and puts it in its own function (with PrintDiff calls when needed). This places a hook for rendering page changes inside the core of PmWiki without changing any functionality of the core software.

Patched PHP file: pagerev_with_renderdiff.php (updated for svn)

Diff file: pagerev_with_renderdiff.diff (updated for svn)