All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
If the abortion is a result of pregnancy from Zina (fornication or adultery), as it appears, then there is a difference of opinion among the jurists on the ruling of marrying a woman who is pregnant from Zina.
The Maaliki and Hanbali Schools, as well as Abu Yusuf from the Hanafi School, are of the view that it is not permissible to marry her before she delivers the baby.
The Shaafi'i and Hanafi Schools are of the view that it is permissible to marry her because there is no sanctity for Zina.
The scholars who permitted marrying a pregnant woman from Zina differed in opinion as well. The Shaafi'i School permitted marrying her, and the Hanafi School prohibited it until she gives birth to the baby.
In our view [in Islamweb], one should act in a manner to be on the safe side and avoid marrying a woman who is pregnant from Zina, in order to avoid the difference of opinion.
As for this marriage that you are asking about in the question, which has already taken place, then we consider that it is acceptable to continue it as a way of acting according to the view of the scholars who are of the opinion that it is valid. Based on this, the girl should be traced back to this man.
Finally, we would like to point out to the following two matters:
Firstly, if that woman intentionally aborted the fetus, then she has to repent sincerely, especially if that took place after the soul is breathed into it, because that is a killing of the soul which Allah has forbidden except with a just cause.
If abortion took place after the fetus has taken human form, the mother is obliged to pay a Diyyah (blood money) that she should give to his heirs but she does not inherit anything from it. For more benefit, please refer to Fatwa 87467.
Secondly, a Muslim should take the initiative to learn useful knowledge, study the rulings of the Sharee'ah, and ask the scholars about what he does not know before acting, especially if the matter is related to private parts, as in principle this is forbidden.
Allah knows best.