Item5941: nofinalnewline attribute in SEARCH not working

Priority: Normal
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Reported By: TWiki:Main.LynnwoodBrown
Waiting For:
Last Change By: KennethLavrsen
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
Priority Normal
CurrentState Closed
Checkins distro:8e5f99aa60e0 distro:abba72847bcf distro:d1aa5ed9fa99
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 Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy