You are here: Foswiki>Tasks Web>Item2181 (07 Jan 2010, MichaelDaum)Edit Attach

Item2181: because the HTML that ICON expands to contains ", you can't use it in a SEARCh format...

pencil
Priority: Normal
Current State: No Action Required
Released In:
Target Release: patch
Applies To: Engine
Component:
Branches:
Reported By: SvenDowideit
Waiting For:
Last Change By: MichaelDaum
there must be a better way than using single quotes, but even that would be an improvement.

-- SvenDowideit - 29 Sep 2009

Made it use single quotes, pending a better solution.

-- CrawfordCurrie - 14 Dec 2009

this has often annoyed me as well, having to resort to ICONURL to construct my own <img> tag. contributing equivalent patch for 1.0.x

-- WillNorris - 14 Dec 2009

This needs to get reverted.

If you change from " to ' you move the problem from SEARCH to IF. And to other places where you use single quotes.

I believe we need a feature for ICON where you can define that the quotes should be either ' or " or $quot or escaped by \. And with the current - before this change - behaviour so we do not break all applications.

Be can probably get away with something like

ICON{"some icon"} gives normal " like today

ICON{"some icon" quotes="escape"} give \"

Ie. in our code we put a small if that replaces " by \"

We need a feature proposal for this

The single quote fix is dead. It will break things everywhere people have used an ICON inside something with single quotes. And you often use single quotes in IF and in searches where you have used double quotes around. I have personally done this many time.

-- KennethLavrsen - 06 Jan 2010

I have raised proposal EscapeQuotesOptionInICON

-- KennethLavrsen - 06 Jan 2010

I am no actioning this.

If the feature proposal or a derivative goes through it should have a new bug item.

I may pull EscapeQuotesOptionInICON as there is a work around.

Work Around

In case someone reads this No Action report.

If you need to use an ICON inside a SEARCH, simple use a construction like..

%SEARCH{"blabla" format="bla $percntICON{name}$percnt" }%

This ensures the icon is translated when the search is done. It may cost a little performance if you have many many search results. However I am sure the performance will be invisible compared to the time the search takes.

-- KennethLavrsen - 07 Jan 2010

... good old html is probably the safest option (kiss).

-- MichaelDaum - 07 Jan 2010
Topic revision: r14 - 07 Jan 2010, MichaelDaum
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