Fixed linking of images

This commit is contained in:
M66B 2022-11-18 09:47:36 +01:00
parent be7fc8d70c
commit 4d57c6356a
1 changed files with 23 additions and 20 deletions

View File

@ -420,26 +420,6 @@ public class HtmlEx {
out.append(((URLSpan) style[j]).getURL());
out.append("\">");
}
if (style[j] instanceof ImageSpan) {
out.append("<img src=\"");
out.append(((ImageSpan) style[j]).getSource());
out.append("\"");
if (style[j] instanceof ImageSpanEx) {
ImageSpanEx img = (ImageSpanEx) style[j];
int w = img.getWidth();
if (w > 0)
out.append(" width=\"").append(w).append("\"");
int h = img.getHeight();
if (h > 0)
out.append(" height=\"").append(h).append("\"");
}
out.append(">");
// Don't output the dummy character underlying the image.
i = next;
}
if (style[j] instanceof AbsoluteSizeSpan) {
AbsoluteSizeSpan s = ((AbsoluteSizeSpan) style[j]);
float sizeDip = s.getSize();
@ -475,6 +455,29 @@ public class HtmlEx {
}
}
for (int j = 0; j < style.length; j++) {
if (style[j] instanceof ImageSpan) {
out.append("<img src=\"");
out.append(((ImageSpan) style[j]).getSource());
out.append("\"");
if (style[j] instanceof ImageSpanEx) {
ImageSpanEx img = (ImageSpanEx) style[j];
int w = img.getWidth();
if (w > 0)
out.append(" width=\"").append(w).append("\"");
int h = img.getHeight();
if (h > 0)
out.append(" height=\"").append(h).append("\"");
}
out.append(">");
// Don't output the dummy character underlying the image.
i = next;
}
}
withinStyle(out, text, i, next);
for (int j = style.length - 1; j >= 0; j--) {