Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ public String execute() {

if (mediaFile.isImageFile()) {
link = "<p>" + mediaFile.getName() + "</p>";
link += "<a href='<url>'><img src='<urlt>' alt='<name>' width='<width>' height='<height>'></img></a>";
link += "<a href=\"<url>\"><img src=\"<urlt>\" alt=\"<name>\" width=\"<width>\" height=\"<height>\" /></a>";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the fix is the missing / of this line and the quote change is to match other generated code? I see usage of both href=' and href=" but double quote is more common so thats good.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Close. There are two changes on that line, and together they make the markup identical to what the entry editor's media chooser inserts, which is the path that renders correctly:

  • </img> becomes a self-closing />, since img is a void element and the closing tag is invalid. That's the / you spotted.
  • The attributes switch from single to double quotes, which also matches the other generated markup.

I changed both together to match the working path, so I can't say which of the two broke rendering on its own.

link = link.replace("<url>", mediaFile.getPermalink())
.replace("<urlt>", mediaFile.getThumbnailURL())
.replace("<name>", mediaFile.getName())
.replace("<width>", ""+mediaFile.getThumbnailWidth())
.replace("<height>", ""+mediaFile.getThumbnailHeight());
} else {
link = "<a href='<url>'><name></a> (<size> bytes, <type>)";
link = "<a href=\"<url>\"><name></a> (<size> bytes, <type>)";
link = link.replace("<url>", mediaFile.getPermalink())
.replace("<name>", mediaFile.getName())
.replace("<size>",""+mediaFile.getLength())
Expand All @@ -97,7 +97,7 @@ public String execute() {
sb.append("<p>")
.append(getText("mediaFileEdit.includesEnclosure"))
.append("<br />")
.append("<a href='" + bean.getEnclosureURL() + "'>")
.append("<a href=\"" + bean.getEnclosureURL() + "\">")
.append(bean.getEnclosureURL())
.append("</a></p>");
}
Expand Down
Loading