Hi B.,
I have also experienced the same thing. Here is what works for me...
I would use one of the Clorox "pens" to bleach out the pink on the white shorts. These "pens" have a fat tip and a narrow tip. I use these pens frequently to spot treat stains on white items that also have color decorations on them. Let the bleach sit for a little while and then wash as usual. Just be careful to not let the treated bleach areas to touch anything with color.
I have three kids (8, 4, and almost 8 months) so I deal with whites all the time and always have great success. I have never had any clothing item yellow since I am very experienced with treating items with bleach.
Hope this helps!
K.