From The Art and Popular Culture Encyclopedia
The trope of the eaten heart was very popular in medieval literature.
The source text of this tale can be traced to the Indian tale in various version of the tale of king Rasalú whose wife cheats on him with a neighboring prince. After killing the prince, Rasalú carries his heart home and serves it to his wife who kills herself.
Other instances include the French Lai d'Ignaure and the tale of the Roman du Châtelain de Coucilet et la Dame de Fayel.