mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Convert new blog posts to HTML. Web URLs are converted to real links and newlines are preserved.
This commit is contained in:
committed by
akwizgran
parent
070a0181d9
commit
07f85b14ec
@@ -2,6 +2,9 @@ package org.briarproject.briar.android.blog;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.util.Linkify;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
@@ -123,7 +126,11 @@ public class WriteBlogPostActivity extends BriarActivity
|
||||
input.setVisibility(GONE);
|
||||
progressBar.setVisibility(VISIBLE);
|
||||
|
||||
storePost(text);
|
||||
SpannableStringBuilder ssb = SpannableStringBuilder.valueOf(text);
|
||||
Linkify.addLinks(ssb, Linkify.WEB_URLS);
|
||||
String html = Html.toHtml(ssb);
|
||||
|
||||
storePost(html);
|
||||
return new MutableLiveData<>(SENT);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user