Purana Jyotisha Sangraha · by Vyasa
Chapter 4 · Moon at Prabhasa, Mars at Kashi
शिवपुराणम् : कालज्ञानम् उत्पाताः ग्रहक्षेत्राणि च
तं दृष्ट्वा शंकरो देवः प्रसन्नोऽभूत्ततः प्रभुः ।आविर्भूय विधुं प्राह स्वभक्तं भक्तवत्सलः ॥ ४१ ॥
From the Shiva Purana, print Kotirudra Samhita ch 14, verse 41.
Seeing him, Lord Shankara became pleased. Kind to his devotees, he appeared and spoke to the Moon, his devotee.
Simple meaning: The text says Shiva was pleased and appeared before the Moon.
वरं वृणीष्व भद्रं ते मनसा यत्समीप्सितम् ।
The text says Shiva told the Moon to choose any boon.
यदि प्रसन्नो देवेश किमसाध्यं भवेन्मम ।
The text says the Moon asked Shiva to stop the wasting of his body.
क्षंतव्यो मेऽपराधश्च कल्याणं कुरु सर्वदा ।
The text says the Moon asked for forgiveness and Shiva answered.