mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-25 23:20:53 +01:00
Reset unused cids, refactoring
This commit is contained in:
@@ -43,6 +43,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -288,4 +289,16 @@ public class HtmlHelper {
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
static List<String> getCids(String html) {
|
||||
List<String> result = new ArrayList<>();
|
||||
|
||||
for (Element element : Jsoup.parse(html).select("img")) {
|
||||
String src = element.attr("src");
|
||||
if (src.startsWith("cid:"))
|
||||
result.add("<" + src.substring(4) + ">");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user