NOTE: If you are a developer, please use a private wiki based on foswiki/trunk on a daily base ...or use trunk.foswiki.org to view this page for some minimal testing.
Use Item9693 for docu changes for 1.2 and 2.0.

Item11556: $n newline format token doesn't seem to be expanded consistently in SEARCH formats

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Low New Engine    
The docco says Use $n() if followed by alphanumeric character.

$n$formfield(Summary)$n= is detectable, given that the following char is not alphanumeric, its a $.

Similarly, $n$n$n$web is rendered as \n\n$nBlog for some inane reason.

Mind you, It can't be that hard to detect that there's an unexpanded $ in there and work backwards until we get it.

%STARTSECTION{"query"}%
%SEARCH{
web="Blog"
type="query"
"form.name ~ 'BlogPostForm'"
date="P1w/$today"
excludetopic="*Template"
order="formfield(PublishingDate)"
reverse="on"
NNnonoise="on"
format="---+++ [[$web.$topic][$formfield(Title)]] $nby $formfield(Author) $n$formfield(Summary)$n $n$n$n$web"
}%
%ENDSECTION{"query"}%

renders as

Searched: form.name ~ 'BlogPostForm'
Number of topics: 0

I think the right approach is to either make the detection cleverer, by sorting the list of tokens by length, then replacing the longest first, matching greedily, but that has a small chance of tripping up someone that relies on the quirk produced by the code we have.

To work out if that is a reasonable worry, it'll be worth testing on a number of older releases - as we re-jiggered how the processing was done a few times, which may have resulted in different corner cases.

if that approach does not fly, then we should start by replacing all $n tokens that are not followed by and alphanum with $n(). that way at least the $n$ cases will not be broken.

-- SvenDowideit - 24 Feb 2012

 

ItemTemplate edit

Summary $dollarn newline format token doesn't seem to be expanded consistently in SEARCH formats
ReportedBy SvenDowideit
Codebase 1.1.4, trunk
SVN Range
AppliesTo Engine
Component
Priority Low
CurrentState New
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r1 - 24 Feb 2012, SvenDowideit
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads