A woman can only be divorced in Islam while she is in a state of purity and her husband has not approached her for (sexual relations) or while she is pregnant and her pregnancy is very obvious. This shows that he consciously made the decision (on divorce).
Imam Ahmad said: divorcing a pregnant woman is supported in the Sunnah as evident in the Hadith of Ibn Umar who was ordered to reverse the pronunciation of divorce he made on his menstruating wife until she is pure from menstruation or becomes pregnant.
As for the divorced woman, if she is pregnant, she is entitled to alimony until her waiting period end. The period ends as soon as she gives birth even if she delivers the baby the next minute after her divorce.
As for the one who was divorced while she was not pregnant, she is also entitled to alimony throughout her waiting period. If she is menstruating, her waiting period is three menstrual cycles, and if she is not menstruating, her waiting period is three months. If, however, after completing her Iddah, she fails to acknowledge the fact that her waiting period has ended, she still has the right to alimony for up to a year counting from the day the divorce was pronounced.