Is benefit > risk? Some women need to continue or take medication during pregnancy for ongoing medical problems or those that develop during pregnancy or childbirth. Discussion between patient and prescribing doctor should include reason for medication, risks and side effects of that drug to mom and to baby, benefits of treatment, alternatives to that drug. If patient agrees with it, she should take only as directed.
Ask your OB provider. Definitely start by asking your provider. I generally give a handout at the first visit with a list of approved meds. You can also look up the pregnancy category. Categories a, b, & c are generally considered safe. Category d and x should be avoided.