Feature Proposal: Option to avoid completely flattening text in FormattedSearch's $summary(nnn)

Motivation

When presenting a list of search matches to a user, we may use $summary(nnn) to give the user more context for each result.

Sometimes (especially in a Foswiki blog app I'm working on), it would be immensely useful if the formatting was not entirely flattened.

In my case, at a minimum it would be desirable to preserve hyperlinks, especially when the search summary occasionally already shows all the information the user wanted out of the search result anyway.

It's inconvenient in these cases for the user to navigate to the topic just so that they can click a link that could have been displayed in the summary in the first place.

NB: See also Tasks.Item1376

Description and Documentation

I propose we add some more options to the $summary() token. I note that DBQUERY has already done so.

For now I can think of two additional options that would be useful: hyperlinks, to preserve wiki (square bracket) hyperlinks, and styles to preserve simple bold (*), monowidth (=) and italics (_) styling.

Examples

  • $summary(200, hyperlinks) - preserve [[]] hyperlinks
  • $summary(200, styles) - preserve simple italics/bold/mono styling
  • $summary(200, styles, hyperlinks) - preserve both

Impact


%WHATDOESITAFFECT%
edit

Implementation

I haven't thought through how this would be accomplished, and perhaps this proposal is non-trivial (given that I've never looked at the FormattedSearch parser/code).

It would take more than a single pass of the text being summarised to be able to render a partially formatted summary of a defined char count.

-- Contributors: PaulHarvey - 03 Aug 2009

Discussion

Topic revision: r2 - 16 Mar 2017, 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