Fixed replacing signatures

This commit is contained in:
M66B 2018-11-15 07:17:59 +01:00
parent aab0a0987b
commit f97cf4307a
1 changed files with 2 additions and 1 deletions

View File

@ -188,9 +188,10 @@ public class FragmentCompose extends FragmentEx {
String html = Html.toHtml(etBody.getText()); String html = Html.toHtml(etBody.getText());
Log.i(Helper.TAG, html); Log.i(Helper.TAG, html);
int cstart = html.indexOf("<tt>"); int cstart = html.indexOf("<tt>");
int cend = html.indexOf("</tt>"); int cend = html.lastIndexOf("</tt>");
if (cstart >= 0 && cend > cstart) { if (cstart >= 0 && cend > cstart) {
html = html.substring(0, cstart + 4) + signature + html.substring(cend); html = html.substring(0, cstart + 4) + signature + html.substring(cend);
Log.i(Helper.TAG, "tt html="+html);
etBody.setText(Html.fromHtml(html)); etBody.setText(Html.fromHtml(html));
} }
} }