I am trying to format some text based on some patterns.
Clear[highlight];
SetAttributes[highlight, HoldAll];
highlight[pattern_, style_] :=
s_String :> Row[List @@ StringReplace[s, t : pattern :> style[t]]]
This works fine and dandy if a match is found:
"foo bar baz" /. highlight["foo", Style[#, Red] &]
But doesn't if no match is found:
"fu bar baz" /. highlight["foo", Style[#, Red] &]
Row["fu bar baz"]
The failure to match has left us with an ugly Row. I'm having a bit of trouble fixing this case, perhaps you can help?

Withhas any implication to help me to solve my question here?: http://mathematica.stackexchange.com/q/95912/7251 Thanks – Jonathan Prieto-Cubides Oct 31 '15 at 06:08Row. – Leonid Shifrin Oct 31 '15 at 10:56