forked from teamnwah/openmw-tes3coop
Consider <p> tag when discarding post-EOL tag text (regression #4473)
This commit is contained in:
parent
64cc3b3a6a
commit
35b0546737
1 changed files with 7 additions and 4 deletions
|
@ -31,13 +31,16 @@ namespace MWGui
|
||||||
|
|
||||||
boost::algorithm::replace_all(mText, "\r", "");
|
boost::algorithm::replace_all(mText, "\r", "");
|
||||||
|
|
||||||
// vanilla game does not show any text after last <BR> tag.
|
// vanilla game does not show any text after the last EOL tag.
|
||||||
const std::string lowerText = Misc::StringUtils::lowerCase(mText);
|
const std::string lowerText = Misc::StringUtils::lowerCase(mText);
|
||||||
int index = lowerText.rfind("<br>");
|
int brIndex = lowerText.rfind("<br>");
|
||||||
if (index == -1)
|
int pIndex = lowerText.rfind("<p>");
|
||||||
|
if (brIndex == pIndex)
|
||||||
mText = "";
|
mText = "";
|
||||||
|
else if (brIndex > pIndex)
|
||||||
|
mText = mText.substr(0, brIndex+4);
|
||||||
else
|
else
|
||||||
mText = mText.substr(0, index+4);
|
mText = mText.substr(0, pIndex+3);
|
||||||
|
|
||||||
registerTag("br", Event_BrTag);
|
registerTag("br", Event_BrTag);
|
||||||
registerTag("p", Event_PTag);
|
registerTag("p", Event_PTag);
|
||||||
|
|
Loading…
Reference in a new issue