Foswiki on GitHub is open for business! Next release meeting: Monday September 29, 1300Z

Item5941: nofinalnewline attribute in SEARCH not working

Priority: CurrentState: AppliesTo: Component: WaitingFor:
Normal Closed Engine    
The nofinalnewline attribute does not seem to be working as described in documentation. As I understand the documentation, the following search within a table should not break the table by inserting a new line after the search results, yet it does.

| some text | %SEARCH{"WebHome" scope="topic" nonoise="on" limit="1" nofinalnewline="on" format="$topic" }% some more text | more |

some text DakarRevisedWebHome some more text more

And yet, the same search without the nofinalnewline does work (ie is also the opposite of the docco):

some text DakarRevisedWebHome some more text more

-- TWiki:Main/LynnwoodBrown - 19 Aug 2008

VarSEARCH says:
If on, the search variable does not end in a line by itself. Any text continuing immediately after the search variable on the same line will be rendered as part of the table generated by the search, if appropriate. (default off)

It'll be important to work out when the code changed, and why (probly because its a bad default)

-- SvenDowideit - 10 Nov 2008 - 06:57

Yes. This feature does the exact opposite of the documentation.

Best is to

  • Fix it so it does what it says. Trying to make nofinalnewline="on" meaning add newline is damaging.
  • Change the default so when you have not defined it, no newline is added.

Alternative is to remove this awful feature. If the default is not to add newline, then people will have added the newline by hitting return after the SEARCH.

I will fix and change default for now.

Please review and think this over.

-- KennethLavrsen - 01 Apr 2010

Fix checked in

Unit test pending further SEARCH fixes I am working on

-- KennethLavrsen - 01 Apr 2010

Unit test added. Waiting for release

-- KennethLavrsen - 01 Aug 2010

ItemTemplate edit

Summary nofinalnewline attribute in SEARCH not working
ReportedBy TWiki:Main.LynnwoodBrown
Codebase 1.0.9, trunk
SVN Range TWiki-5.0.0, Mon, 18 Aug 2008, build 17431
AppliesTo Engine
Component
Priority Normal
CurrentState Closed
WaitingFor
Checkins Foswikirev:7025 Foswikirev:7026 Foswikirev:8392
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r10 - 04 Oct 2010, KennethLavrsen
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License