Add a tiny hack to support <nolink> tag

This commit is contained in:
Liru Færs
2019-11-16 15:46:36 -05:00
parent 0b4f576c54
commit 7d0cbf6d02
3 changed files with 11 additions and 5 deletions

View File

@@ -4295,6 +4295,12 @@ void LLTextEditor::appendTextImpl(const std::string &new_text, const LLStyleSP s
};
auto append_link = [&](const std::string& link, LLStyleSP link_style)
{
if (!link_style->isLink())
{
appendAndHighlightText(link, part, style);
return;
}
if (style) // Respect styling
{
const auto& text_style = *style;
@@ -4432,7 +4438,7 @@ void LLTextEditor::appendAndHighlightText(const std::string& new_text, S32 highl
std::string::size_type start = 0;
/*std::string::size_type pos = new_text.find('\n',start);
while(pos!=-1)
while(pos != std::string::npos)
{
if(pos!=start)
{

View File

@@ -1430,8 +1430,9 @@ std::string LLUrlEntryNoLink::getLabel(const std::string &url, const LLUrlLabelC
LLStyleSP LLUrlEntryNoLink::getStyle() const
{
// Don't render as URL (i.e. no context menu or hand cursor).
// Singu Note: What the heck? No, that's misleading!!
return LLUrlEntryBase::getStyle();
LLStyleSP style(new LLStyle());
style->setLinkHREF(" ");
return style;
}
@@ -1536,4 +1537,3 @@ std::string LLUrlEntryJira::getUrl(const std::string &url) const
}
// </alchemy>

View File

@@ -58,7 +58,7 @@ void LLUrlMatch::setValues(U32 start, U32 end, const std::string &url, const std
mTooltip = tooltip;
mIcon = icon;
mStyle = style;
mStyle->setLinkHREF(url);
mStyle->setLinkHREF(mStyle->isLink() ? LLStringUtil::null : url); // Singu Note: This hack exists in lieu of no link flag
mMenuName = menu;
mLocation = location;
mID = id;