Purana Jyotisha Sangraha · by Vyasa
Chapter 4 · Moon at Prabhasa, Mars at Kashi
शिवपुराणम् : कालज्ञानम् उत्पाताः ग्रहक्षेत्राणि च
समाश्रितस्तदा दैत्यान्युद्धं देवैश्चकार ह ।मयाऽत्रिणा निषिद्धश्च तस्मै तारां ददौ शशी ॥ २७ ॥
From the Shiva Purana, print Kotirudra Samhita ch 14, verse 27.
"Then he took shelter with the demons and fought the gods. I and Atri forbade him, and the Moon gave Tara back to him."
Simple meaning: The text says the Moon fought the gods, then gave Tara back to Jupiter.
तां च गर्भवतीं दृष्ट्वा न गृह्णामीति सोऽब्रवीत् ।
The text says Jupiter first refused Tara, then took her back with difficulty.
यदि गर्भं जहातीह गृह्णामीत्यब्रवीत्पुनः ।
The text says Jupiter agreed to take Tara back if she gave up the child.
कस्यायं च पुनर्गर्भस्सोमस्येति च साऽब्रवीत् ।
The text says Tara named the Moon as the child's father and Jupiter took her back.