[pmwiki-users] Edit preview and page view can render Profiles link differently
Patrick R. Michaud
pmichaud at pobox.com
Fri Jun 2 09:53:39 CDT 2006
On Fri, Jun 02, 2006 at 09:27:22AM -0400, Curtis, Clayton wrote:
> While working my way through the various pages on AuthUser, I happened to
> notice that Hagan Fox's profile link in the Contributors section of the
> AuthUser page (http://www.pmwiki.org/wiki/Cookbook/AuthUser) was
> "undefined" (i.e., wanted to generate a new page). So, wanting to
> contribute as a low-level sanitation worker, I went to try to "fix" it and
> discovered that it renders just fine in the Preview.
> The markup is:
> * [[~Pm]]
> * [[~HaganFox|Hagan Fox]] 2005-06-21,29
> * [[~HansB]] 22-6-05
> * [[~NeilHerber]] June 22, 2005, at 11:06 PM
> * [[~BenWilson]]
Aha! Found it!
This bug has been intermittently floating around for some time,
reported in PITS:00671 and PITS:00611, but I never could figure
out what was going on until now. The key is that it only fails
for profile links with link text, and then it depends on the
internal ordering of PmWiki's markup rule tables (equivalent priority
rules can be in different order from one run to the next).
Details below for those who are interested in such things.
So, with the above example to work from I've finally been able to
close this issue. This fix will appear in 2.1.9. Many thanks!
BTW, I should note that instead of [[~HaganFox|Hagan Fox]] one
can also write [[~Hagan Fox]] and get the same effect.
Detailed description of what was happening: The problem has
to do with the relative ordering of the '[[~' rule for author
profiles and the '[[|' rule for links with link text.
Both of these rules were defined as occurring before the
'[[' freelink rule, i.e., a call to markup with the second
parameter as '<[['.
However, in order for [[~Author | link text]] to work, the
[[~ rule has to occur before the [[| rule. When both are
defined as '<[[', then both rules have the same "priority",
and sometimes the sort puts the [[~ rule first (good)
and other times it puts the [[| first (bad). So, the
fix is simply to make sure that the [[~ rule occurs before
all of the other [[ markups, by using '<links' as the $where
parameter to Markup().
More information about the pmwiki-users