Would the &stripOutput function help here?
Yes. The default stripOutput fonction is defined as follow:
/**
* defaultStripOutput : default ouput strip function
*/
function defaultStripOutput($text){
if ($text !== ''){
// replace line breaking tags with whitespace
$text = stripLineBreaking($text);
// strip modx sensitive tags
$text = stripTags($text);
// strip Jscripts
$text = stripJscripts($text);
// strip html tags. Tags should be correctly ended
$text = stripHTML($text);
}
return $text;
}So the stripHTML function cleans your links. To avoid that, in your config file, defined your own stripOutput function with something like that:
/**
* stripHtmlExceptLink : Remove HTML sensitive tags except link tag <a></a>
*/
function stripHtmlExceptLink($text){
$text = strip_tags($text,'<a>');
return $text;
}
function myStripOutput($text){
if ($text !== ''){
// replace line breaking tags with whitespace
$text = stripLineBreaking($text);
// strip modx sensitive tags
$text = stripTags($text);
// strip Jscripts
$text = stripJscripts($text);
// strip html tags. Tags should be correctly ended
$text = stripHtmlExecptLink($text);
}
return $text;
}
Here the function strip_tags($text,’<a>’); save your links. See
Strip_tags
Functions stripLineBreaking(), stripTags() and stripJscripts() are provided by AjaxSearch. So don’t redefined them.
And finally adds &stripOutput=`myStripOutput` in your snippet call
Try it and let me know the results.