Scholars like Gopinatha Rao, Shanti Lal Nagara, S K Ramachandra Rao and Vettam Mani state that the story of Shiva attacking Yama to save Markandeya has a Puranic origin. But, I detailly searched this story in Puranas. A version of Bhagavatha Purana (16.12.6) says Mahakala (Shiva) turned away the Kala (Yama) and saved Markandeya. Similarly, Shiva Purana (6.2.4) says the sage Markandeya got eternity by the boon of Shiva. Besides these mentions, no major Purana gives a detailed account of this incident.
On the other hand, the Tamil literary works, namely Thevaram hymns, severely mention Shiva saving Markandeya from Yama. I'm baffled about it. It would be helpful if anybody could help me find this myth's source.