Bug: Preview Expands Variables Twice
The
PreviewCgiScript expands variables twice, but
ViewCgiScript only once, as reported in
VariableExpandsInPreviewButNotInNormalView.
Test case
Write:
%CALC{AAA $NOP(%)CALC{BBB}$NOP(%) ZZZ}%
Preview renders as:
AAA BBB ZZZ
View renders as:
AAA %CALC{BBB}% ZZZ
Test:
AAA %CALC{BBB}% ZZZ
The nested CALC should not get resolved in preview.
Environment
--
PeterThoeny - 06 Mar 2004
Follow up
This needs to be aligned with view, which also improves the performance in preview.
Fix record
Removed extra
TWiki::handleCommonTags( ) call in preview script.
Change in
TWikiAlphaRelease and TWiki.org:
*** bu4/preview 2003-11-23 20:22:25.000000000 -0800
--- preview 2004-03-09 11:23:00.000000000 -0800
***************
*** 150,160 ****
# do not allow click on link before save: (mods by TedPavlic)
my $oopsUrl = '%SCRIPTURLPATH%/oops%SCRIPTSUFFIX%/%WEB%/%TOPIC%';
$ptext =~ s@(?<=<a\s)([^>]*)(href=(?:".*?"|[^"].*?(?=[\s>])))@$1href="$oopsUrl?template=oopspreview"@goi;
$ptext =~ s@<form(?:|\s.*?)>@<form action="$oopsUrl">\n<input type="hidden" name="template" value="oopspreview">@goi;
$ptext =~ s@(?<=<)([^\s]+?[^>]*)(onclick=(?:"location.href='.*?'"|location.href='[^']*?'(?=[\s>])))@$1onclick="location.href='$oopsUrl\?
template=oopspreview'"@goi;
- $ptext = &TWiki::handleCommonTags( $ptext, $topic );
$ptext = &TWiki::putBackVerbatim( $ptext, "pre", @verbatim );
$tmpl = &TWiki::handleCommonTags( $tmpl, $topic );
--- 150,160 ----
# do not allow click on link before save: (mods by TedPavlic)
my $oopsUrl = '%SCRIPTURLPATH%/oops%SCRIPTSUFFIX%/%WEB%/%TOPIC%';
+ $oopsUrl = &TWiki::handleCommonTags( $oopsUrl, $topic );
$ptext =~ s@(?<=<a\s)([^>]*)(href=(?:".*?"|[^"].*?(?=[\s>])))@$1href="$oopsUrl?template=oopspreview"@goi;
$ptext =~ s@<form(?:|\s.*?)>@<form action="$oopsUrl">\n<input type="hidden" name="template" value="oopspreview">@goi;
$ptext =~ s@(?<=<)([^\s]+?[^>]*)(onclick=(?:"location.href='.*?'"|location.href='[^']*?'(?=[\s>])))@$1onclick="location.href='$oopsUrl\?
template=oopspreview'"@goi;
$ptext = &TWiki::putBackVerbatim( $ptext, "pre", @verbatim );
$tmpl = &TWiki::handleCommonTags( $tmpl, $topic );
--
PeterThoeny - 06 Mar 2004
Fixed issue of oops links with unresolved variables. Fix is in
TWikiAlphaRelease and at TWiki.org.
--
PeterThoeny - 09 Mar 2004