Skip to content

Commit

Permalink
Hide (and don't create links for) emotes
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumBadger committed Jun 15, 2020
1 parent cedd330 commit a0d6a43
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,12 @@ public static HtmlRawElement readFrom(@NonNull final HtmlReaderPeekable reader)

result = new HtmlRawElementTagPassthrough(children);

} else if(href.startsWith("#")
&& href.length() > 2
&& (children.isEmpty()
|| new HtmlRawElementBlock(BlockType.NORMAL_TEXT, children)
.getPlainText().trim().isEmpty())) {

result = new HtmlRawElementPlainText("<emote: " + href + ">");
} else if(href.startsWith("#")) {
// Probably an emote: pass through the text, but don't make a link
result = new HtmlRawElementTagPassthrough(children);

} else {
result = new HtmlRawElementTagAnchor(
children,
href);
result = new HtmlRawElementTagAnchor(children, href);
}
break;
}
Expand Down

0 comments on commit a0d6a43

Please sign in to comment.