You are here: Foswiki>Tasks Web>Item10507 (19 Mar 2011, GeorgeClark)Edit Attach

Item10507: VarSEARCH noms HTML entities in $summary output, behaves strangely

pencil
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: SEARCH
Branches:
Reported By: AaronFuleki
Waiting For:
Last Change By: GeorgeClark
I've noticed some strange behavior when using the $summary formatting token in my %SEARCH% macros:
  1. Ampersands get chopped off of HTML entities, so things like quotes look like #34;this#34; instead of "this" in the rendered output.
  2. Entities seem to count toward the character count when applying a character limit to summary output. If there are entities in the summary string, it will be truncated prematurely.
  3. There seems to be a minimum character count on the summary token (maybe around 15 characters), which isn't stated in the documentation, and doesn't seem necessary.

I've managed to work around #1 with some FilterPlugin regex:

%SUBST{text="$summary" pattern="(#(\d+);)" format="&$1"}%

...but that only fixes numeric entities, as I thought ((\w+);) might match too many things that weren't actually entities (not that the current workaround won't do that too).

%SEARCH% should really preserve entities, and count them as one character.

-- AaronFuleki - 18 Mar 2011

Confirmed.

-- GeorgeClark - 19 Mar 2011
 

ItemTemplate edit

Summary VarSEARCH noms HTML entities in $summary output, behaves strangely
ReportedBy AaronFuleki
Codebase 1.1.2
SVN Range
AppliesTo Engine
Component SEARCH
Priority Normal
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
Topic revision: r2 - 19 Mar 2011, GeorgeClark
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