Having gone through a delicate IVF journey, I completely avoided it just for my peace of mind. But scientifically, small amounts of ripe fruit are safe.
Look, unless you are eating 10 whole pineapples a day, it won't harm you. A small bowl of ripe pineapple is completely safe, just don't have unripe ones.
I was very careful with fruits due to my sugar levels, but had small portions occasionally. Ripe pineapple in moderation is safe, but do ask your doctor if you have any doubts.