@4hero and Sylvaticus
As demo I have used the StripOutput function provided by the new version Ajaxsearch 1.8 to show the images in the search Results.
You could see the demo on the ajaxSearch Demo site. In the drop down list use all the searchWords (select them with the ctrl key).
These search words are labels of <img > tags found in the english documents of the site.
The stripOutput function is very simple:
function myStripOutput($results){
// renanme <img .... > tag by imgStart ... imgEnd
$results = preg_replace("/\<img(.*?)\>/si","imgStart\$1imgEnd", $results );
// replace line Breaking by space
$results = stripLineBreaking($results);
// strip other html tags
$results = stripHtml($results);
// strip javascript tags
$results = stripJscripts($results);
// renanme imgStart ... imgEnd by <img .... > tag
$results = preg_replace("/imgStart(.*?)imgEnd/si","<img\$1\>", $results );
return $results;
}1/ using a regular expression, all the <img (...) > tags are replaced by imgStart (...) imgEnd.
2/ you use the stripLineBreaking, stripHtml and stripJscripts function available with AS to strip all other tags
3/finally you replace again imgStart (...) imgEnd by <img (...) > tags
So at the end, all html tags have been cleaned, except <img > tags.
You could download the "image" config file used from the same demo page.
Probably the function could/should be improved but this is a first step. If you have any suggestion to improve it, let me know, it could be interesting, to share these tricks.