Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: TocPlugin
Branches:
Symptom:
The %CONTENTS% link is not being replaced by the error message if there is a problem in WebOrder.
How to Replicate:
Create a WebOrder topic that looks like this:
%ANCHOR%
%REFTABLE%
%CONTENTS%
%TOCCHECK%
* Introduction
* Introduction
When you view it you will see something that looks like this:
.
This is incorrect. It should look like this:
.
Solution:
The problem is that the regexp used to replace tags in
TocPlugin::Section::_replaceTypeTags is overoptimized. Here's the code:
598 # remove tags of a given type from a string
599 sub _replaceTypeTags {
600 my ($type, $text, $alt) = @_;
601 $text =~ s/%$type({[^%]*})?%/$alt/geo;
602 return $text;
603 }
604
Note the
geo
modifier in line 601. This freezes the string for the very first value of
$type
, preventing any further successful replacement for any other value of
$type
.
_replaceTypeTags
is called only by _replaceAllTags=, which calls it with the tags in the order specified in the above example WebOrder topic. The fix is simple. Remove the
o
from
geo
on line 601.
--
DiabJerius - 10 Jan 2011
Done
--
CrawfordCurrie - 24 Mar 2011