Added JSON-LD option

This commit is contained in:
M66B
2023-11-27 18:49:42 +01:00
parent 1387e16366
commit b829638352
4 changed files with 26 additions and 3 deletions

View File

@@ -3033,6 +3033,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
final int zoom = args.getInt("zoom");
final float scale = args.getFloat("scale");
final boolean download_plain = prefs.getBoolean("download_plain", false);
final boolean json_ld = prefs.getBoolean("json_ld", false);
if (message == null || !message.content)
return null;
@@ -3166,7 +3167,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
args.putBoolean("has_amp", has_amp);
// Check for structured email
if (BuildConfig.DEBUG)
if (json_ld)
for (Element struct : document.select("script[type=application/ld+json]"))
try {
document.body().append(new StructuredEmail(struct.html()).getHtml(context));