fix(HtmlParser): remove trailing line breaks
Some fediverse servers (e.g. lemmy) add a trailing line break to the content. Since we add them as well, this can cause up to three line breaks at the end of a post, resulting in a blank space. This removes the trailing line breaks before parsing the content.
This commit is contained in:
parent
e8ce2a7e35
commit
618946a8c6
|
@ -123,6 +123,9 @@ public class HtmlParser{
|
|||
int colorInsert=UiUtils.getThemeColor(context, R.attr.colorM3Success);
|
||||
int colorDelete=UiUtils.getThemeColor(context, R.attr.colorM3Error);
|
||||
|
||||
if(source.endsWith("\n"))
|
||||
source=source.stripTrailing();
|
||||
|
||||
Jsoup.parseBodyFragment(source).body().traverse(new NodeVisitor(){
|
||||
private final ArrayList<SpanInfo> openSpans=new ArrayList<>();
|
||||
|
||||
|
|
Loading…
Reference in New Issue