Added image links

pull/199/head
M66B 4 years ago
parent 243d7b836b
commit 64c04ee8a5

@ -1026,10 +1026,22 @@ public class HtmlHelper {
if (alt.length() > MAX_ALT) if (alt.length() > MAX_ALT)
alt = alt.substring(0, MAX_ALT) + "…"; alt = alt.substring(0, MAX_ALT) + "…";
if (!show_images && !(inline_images && isInline) && !TextUtils.isEmpty(alt)) if (!show_images && !(inline_images && isInline))
if (TextUtils.isEmpty(tracking)) if (TextUtils.isEmpty(tracking)) {
if (TextUtils.isEmpty(alt)) {
boolean linked = false;
Element p = img.parent();
while (p != null && !linked)
if ("a".equals(p.tagName()))
linked = true;
else
p = p.parent();
if (linked)
alt = context.getString(R.string.title_image_link);
}
if (!TextUtils.isEmpty(alt))
img.appendText("[" + alt + "]"); img.appendText("[" + alt + "]");
else { } else if (!TextUtils.isEmpty(alt)) {
Element a = document.createElement("a"); Element a = document.createElement("a");
a.attr("href", tracking); a.attr("href", tracking);
a.text("[" + alt + "]"); a.text("[" + alt + "]");

@ -1474,6 +1474,7 @@
<string name="title_hint_eml">This is a summary of the content of a raw message file. Save the raw message with the save icon in the action bar to view all content.</string> <string name="title_hint_eml">This is a summary of the content of a raw message file. Save the raw message with the save icon in the action bar to view all content.</string>
<string name="title_open_link">Open link</string> <string name="title_open_link">Open link</string>
<string name="title_image_link">Image link</string>
<string name="title_different_link">The title and the link address are different</string> <string name="title_different_link">The title and the link address are different</string>
<string name="title_tracking_link">This website might track you</string> <string name="title_tracking_link">This website might track you</string>
<string name="title_suspicious_link">This is a suspicious link</string> <string name="title_suspicious_link">This is a suspicious link</string>

Loading…
Cancel
Save