It just doesn't replace any part of the markup. The str_replace callback works on all other characters in the string, except the search highlight markup. What am I missing? Whats even more confusing is that I'm logging $value and the log file contains the vanilla value without any markup.
I'm trying to remove the markup that gets added to an exported field value when the search highlighting triggers. For example:
If I perform a search for
Hoeger
and export the results, my CSV cell data contains:Hermann-<span class="bg-yellow-100">Hoeger</span>
So I try to perform a
str_replace()
on$value
using theexportCallback()
method like so: ( a more obvious example below )It just doesn't replace any part of the markup. The str_replace callback works on all other characters in the string, except the search highlight markup. What am I missing? Whats even more confusing is that I'm logging
$value
and the log file contains the vanilla value without any markup.