Woops, each link needs its own style! Thanks for testing, Torric!

This commit is contained in:
Lirusaito
2019-01-20 04:37:53 -05:00
parent 3a159111f3
commit 4b4c8c8e37

View File

@@ -4183,15 +4183,15 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s
LL_RECORD_BLOCK_TIME(FTM_PARSE_HTML);
S32 start=0,end=0;
LLUrlMatch match;
LLStyleSP link_style(new LLStyle);
if (style) *link_style = *style;
link_style->setColor(mLinkColor ? *mLinkColor : LLUI::sConfigGroup->getColor4("HTMLLinkColor"));
const auto& link_color = mLinkColor ? *mLinkColor : LLUI::sConfigGroup->getColor4("HTMLLinkColor");
auto append_substr = [&](const size_t& pos, const size_t& count)
{
appendAndHighlightText(text.substr(pos, count), part, style);
};
auto append_link = [&](const std::string& link)
{
LLStyleSP link_style(style ? new LLStyle(*style) : new LLStyle);
link_style->setColor(link_color);
link_style->setLinkHREF(match.getUrl());
appendAndHighlightText(link, part, link_style);
};