Share HTML improvements

pull/209/head
M66B 2 years ago
parent f3479d91cf
commit e65d7b9c75

@ -6761,7 +6761,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
protected File onExecute(Context context, Bundle args) throws IOException { protected File onExecute(Context context, Bundle args) throws IOException {
Long id = args.getLong("id"); Long id = args.getLong("id");
File file = EntityMessage.getFile(context, id); DB db = DB.getInstance(context);
EntityMessage message = db.message().getMessage(id);
if (message == null || !message.content)
return null;
File file = message.getFile(context);
Document d = JsoupEx.parse(file); Document d = JsoupEx.parse(file);
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
@ -6773,6 +6778,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
HtmlHelper.overrideWidth(d); HtmlHelper.overrideWidth(d);
} }
d.head().prependElement("meta").attr("charset", "utf-8");
if (message.language != null)
d.body().attr("lang", message.language);
List<CSSStyleSheet> sheets = List<CSSStyleSheet> sheets =
HtmlHelper.parseStyles(d.head().select("style")); HtmlHelper.parseStyles(d.head().select("style"));
for (Element element : d.select("*")) { for (Element element : d.select("*")) {

Loading…
Cancel
Save