It is forbidden to tie the nuptial knot (Nikaah) while the bride is pregnant. The fornicator(s) should repent sincerely to Allah and the bride should wait for a menstrual cycle after giving birth! The correct position which is that of the majority of Muslim scholars is the forbiddance of the attribution of the kid born from fornication to the fornicating biological father! A child born this way will not inherit the biological father accordingly! Also forbidden is aborting the fetus as a result of the shame of fornication!

Preface:
This is common in many tribes in Nigeria and in many countries all over the world. The bride get pregnant before they think about solemnizing the union in Nikaah! And some Muslims are not left out in this backward culture as sometimes there exist an agreement between the dating partners to do the Nikaah when pregnancy is confirmed!
Firstly:
It is permissible for the one who committed zina (Illegal sex) to marry the woman with whom he committed zina if they are no longer regarded as zaani (Fornicators) , which is after repenting sincerely. If she is pregnant, it is not permissible to do the marriage contract with her until her pregnancy ends, and the child is not to be named after the zaani according to the majority of scholars. Some scholars are of the view that the illegitimate child is to be called after the zaani if he acknowledges him.

In Fataawa al-Lajnah al-Daa’imah it says: What is required of both of them is to repent to Allah then to give up this crime and regret what has happened in the past of committing immoral actions, and they should resolve never to go back to it and they should do a lot of righteous deeds in the hope that Allah will accept their repentance and turn their bad deeds into good deeds. Allah, may He be exalted, says (interpretation of the meaning):
“And those who invoke not any other ilaah (god) along with Allaah, nor kill such person as Allaah has forbidden, except for just cause, nor commit illegal sexual intercourse and whoever does this shall receive the punishment.
69. The torment will be doubled to him on the Day of Resurrection, and he will abide therein in disgrace;
70. Except those who repent and believe (in Islamic Monotheism), and do righteous deeds; for those, Allaah will change their sins into good deeds, and Allaah is Oft‑Forgiving, Most Merciful.

71. And whosoever repents and does righteous good deeds; then verily, he repents towards Allaah with true repentance” [al-Furqaan 25:68-71]
If you want to marry her, you have to wait until it is established that she is not pregnant by waiting for one menstrual cycle before doing the marriage contract with her. If it turns out that she is pregnant, it is not permissible for you to do the marriage contract with her until after the pregnancy ends, in accordance with the words of the Prophet (blessings and peace of Allah be upon him) that a man should not irrigate the crop of another with his water.
End quote from Fataawa al-Lajnah al-Daa’imah, Majallat al-Buhooth al-Islamiyyah, vol. 9, p. 72
Secondly:
It is not permissible to abort the foetus in order to get rid of the shame of zina