- * Small wrapper class on top of HtmlEmail which encapsulates the required logic to retrieve images that are contained in "<img src=../>" elements in the - * HTML code. This is done by replacing all img-src-elements with "cid:"-entries and embedding images in the email. + * Small wrapper class on top of HtmlEmail which encapsulates the required logic to retrieve images and scripts that are contained in + * "<img src=../>" and "<script src=../>" elements in the HTML code. + * This is done by replacing all the src-elements with "cid:"-entries and embedding the images/scripts in the email. *
*
* For local files the class tries to either load them via an absolute path or - if available - use a relative path starting from a base directory. For files
@@ -49,10 +50,10 @@ public class ImageHtmlEmail extends HtmlEmail {
// can be arbitrary text between "IMG" and "SRC" like IDs and other things.
/** Regexp for extracting {@code } tags */
- public static final String REGEX_IMG_SRC = "(<[Ii][Mm][Gg]\\s*[^>]*?\\s+[Ss][Rr][Cc]\\s*=\\s*[\"'])([^\"']+?)([\"'])";
+ public static final String REGEX_IMG_SRC = "(<[Ii][Mm][Gg](?=\\s)[^>]*?\\s[Ss][Rr][Cc]\\s*=\\s*[\"'])([^\"']+)([\"'])";
/** Regexp for extracting {@code