mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-02 13:14:39 +00:00
Detect HTML templates
This commit is contained in:
parent
95afb31925
commit
cb5fdde86b
1 changed files with 7 additions and 1 deletions
|
@ -57,6 +57,7 @@ import androidx.preference.PreferenceManager;
|
|||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import org.github.DetectHtml;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
|
||||
|
@ -454,6 +455,11 @@ public class FragmentAnswer extends FragmentBase {
|
|||
for (SuggestionSpan suggestion : suggestions)
|
||||
edit.removeSpan(suggestion);
|
||||
|
||||
Spanned spanned = etText.getText();
|
||||
String html = (!BuildConfig.PLAY_STORE_RELEASE && DetectHtml.isHtml(spanned.toString())
|
||||
? spanned.toString()
|
||||
: HtmlHelper.toHtml(spanned, getContext()));
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("id", id);
|
||||
args.putString("name", etName.getText().toString().trim());
|
||||
|
@ -467,7 +473,7 @@ public class FragmentAnswer extends FragmentBase {
|
|||
args.putBoolean("hide", cbHide.isChecked());
|
||||
args.putBoolean("external", cbExternal.isChecked());
|
||||
args.putInt("color", btnColor.getColor());
|
||||
args.putString("html", HtmlHelper.toHtml(etText.getText(), getContext()));
|
||||
args.putString("html", html);
|
||||
|
||||
new SimpleTask<Void>() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue