Ibn Katheer (may Allah have mercy on him) said: Imam Ahmad ibn Hanbal (may Allah have mercy on him) was of the view that the marriage of a chaste man to an unchaste woman is not valid so long as she remains like that, unless she is asked to repent. If she repents, the marriage contract will be valid, otherwise it will not. Similarly, it is not valid for a free, chaste woman to be given in marriage to a man who is immoral and unchaste, unless he repents sincerely, because Allah, may He be exalted, says (interpretation of the meaning): “Such a thing is forbidden to the believers” [an-Noor 24:3]. End quote.
Exactly.
Islam is just and Allah is most merciful.