Fix for removeMarkups()

This commit is contained in:
Patryk Skowroński
2024-04-25 11:45:30 +02:00
committed by Chris Hennes
parent 53020def86
commit a4b151e7ff

View File

@@ -113,10 +113,11 @@ void NavlibInterface::removeMarkups(std::string& text) const
if (markupEnd == text.cend())
return;
if (*std::prev(markupEnd) == 'p')
text.insert(std::next(markupEnd), 2, '\n');
const char enclosingChar = *std::prev(markupEnd);
textBegin = text.erase(markupBegin, ++markupEnd);
if(enclosingChar == 'p')
textBegin = text.insert(textBegin, 2, '\n');
}
}