BF and 18wks pregnant

I BF my 2yr old and my nipples are really really getting sore. I’m not sure I want her to stop but if I decide to how do I go about doing it? Also is it okay to keep going until she’s ready to give it up even though I’m pregnant?