Suppress title if same as img alt

pull/209/head
M66B 2 years ago
parent ba186235e0
commit 905d56038d

@ -1037,8 +1037,12 @@ public class HtmlHelper {
if (text_titles) if (text_titles)
for (Element e : document.select("[title]")) { for (Element e : document.select("[title]")) {
String title = e.attr("title"); String title = e.attr("title");
if (!TextUtils.isEmpty(title)) if (TextUtils.isEmpty(title))
e.prependChild(document.createElement("span").text("{" + title + "}")); continue;
if ("img".equals(e.tagName()) &&
title.equals(e.attr("alt")))
continue;
e.prependChild(document.createElement("span").text("{" + title + "}"));
} }
// Replace headings // Replace headings

Loading…
Cancel
Save