|
|
|
@ -30,14 +30,18 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
// vanilla game does not show any text after the last EOL tag.
|
|
|
|
|
const std::string lowerText = Misc::StringUtils::lowerCase(mText);
|
|
|
|
|
int brIndex = lowerText.rfind("<br>");
|
|
|
|
|
int pIndex = lowerText.rfind("<p>");
|
|
|
|
|
if (brIndex == pIndex)
|
|
|
|
|
mText = "";
|
|
|
|
|
else if (brIndex > pIndex)
|
|
|
|
|
mText = mText.substr(0, brIndex+4);
|
|
|
|
|
else
|
|
|
|
|
mText = mText.substr(0, pIndex+3);
|
|
|
|
|
size_t brIndex = lowerText.rfind("<br>");
|
|
|
|
|
size_t pIndex = lowerText.rfind("<p>");
|
|
|
|
|
mPlainTextEnd = 0;
|
|
|
|
|
if (brIndex != pIndex)
|
|
|
|
|
{
|
|
|
|
|
if (brIndex != std::string::npos && pIndex != std::string::npos)
|
|
|
|
|
mPlainTextEnd = std::max(brIndex, pIndex);
|
|
|
|
|
else if (brIndex != std::string::npos)
|
|
|
|
|
mPlainTextEnd = brIndex;
|
|
|
|
|
else
|
|
|
|
|
mPlainTextEnd = pIndex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
registerTag("br", Event_BrTag);
|
|
|
|
|
registerTag("p", Event_PTag);
|
|
|
|
@ -103,7 +107,8 @@ namespace MWGui
|
|
|
|
|
{
|
|
|
|
|
if (!mIgnoreLineEndings || ch != '\n')
|
|
|
|
|
{
|
|
|
|
|
mBuffer.push_back(ch);
|
|
|
|
|
if (mIndex < mPlainTextEnd)
|
|
|
|
|
mBuffer.push_back(ch);
|
|
|
|
|
mIgnoreLineEndings = false;
|
|
|
|
|
mIgnoreNewlineTags = false;
|
|
|
|
|
}
|
|
|
|
|