fix(akkoma-hashtags): an issue where akkoma for some reason needs this for hashtags to open properly

This commit is contained in:
LucasGGamerM
2024-05-26 10:17:26 -03:00
parent 5d3afc1b0e
commit b53997261e

View File

@@ -137,14 +137,12 @@ public class HtmlParser{
String href=el.attr("href");
LinkSpan.Type linkType;
String text=el.text();
if(el.hasClass("hashtag")){
if(text.startsWith("#")){
linkType=LinkSpan.Type.HASHTAG;
href=text.substring(1);
linkObject=tagsByTag.get(text.substring(1).toLowerCase());
}else{
linkType=LinkSpan.Type.URL;
}
if(el.hasClass("hashtag") || text.startsWith("#")){
// MOSHIDON: we have slightly refactored this so that the hashtags properly work in akkoma
// TODO: upstream this
linkType=LinkSpan.Type.HASHTAG;
href=text.substring(1);
linkObject=tagsByTag.get(text.substring(1).toLowerCase());
}else if(el.hasClass("mention")){
String id=idsByUrl.get(href);
if(id!=null){