Has there been a change to how explaintext=1 is processed on an API call? It looks like it's not putting a line feed "\n" at the ends of paragraphs which end with a ref tag, or any spacing at all.
The first three paragraphs on the Wikipedia "Human" article return as follows (when queried as https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&titles=Human&exsentences=20&explaintext=1):
"...more complex brains and societies.Early hominin..."
"...populated most of the world.The spread of humans..."
"...other technologies and arts.\nHumans are uniquely adept..."
The first two paragraphs end with ref tags in the article, the third does not. Testing this on other articles with a mix of ref and non-ref paragraph ends, I see the same result. I've been using the API and explaintext for a while and haven't noticed this behaviour before.