Wa `alaykum as-Salamu wa Rahmatullahi wa Barakatuh.
According to the view of Imam Malik and Ahmad, if a woman is pregnant of an illegitimate child, she cannot get married until she gives birth and declares her repentance of this sin.
According to Imam Ash-Shafi`i and Imam Abu Hanifa, she can get married to the person who had fornication with her even before the birth of that child. I think the view of Ash-Shafi`i is preferred because fornication does not prove any legal right. This is based on the Prophet’s saying, “A born child belongs to [legal] wedlock and the stone is for the adulterer.” (Al-Bukhari)
Umar (may Allah be pleased with him) was reported as slashing a fornicating man and woman and he showed concern on uniting them together through legal marriage.
Almighty Allah knows best.
Views expressed by hosts/guests on this program (live dialogue, Facebook sessions, etc.) are their own and their appearance on the program does not imply an endorsement of them or any entity they represent.