Item10507: VarSEARCH noms HTML entities in $summary output, behaves strangely
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Engine
Component: SEARCH
Branches:
I've noticed some strange behavior when using the
$summary
formatting token in my
%SEARCH%
macros:
- Ampersands get chopped off of HTML entities, so things like quotes look like
#34;this#34;
instead of "this"
in the rendered output.
- 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.
- 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