Yes, they did. Gilly was reading a book at the Citadel and asked Sam what "annulment" meant. After he told her, she mentioned that, in the book she's reading, a Maester had recorded an annulment on behalf of Rhaegar Targaryen. At the same time, the Maester recorded a new marriage between Rhaegar and another woman. I think Gilly also mentions that it happened in Dorne. Oh, and by the way, Sam wasn't paying attention so right now Gilly is the only one who has that information.
So yes, Rhaegar annulled his marriage with Elia Martell in order to marry Lyanna Stark. Jon Snow isn't a bastard, he's a legitimate Targaryen and has a stronger claim to the throne than Dany does.