Skip to content

Commit

Permalink
Updated legacy editor to place captions the same way as the web edito…
Browse files Browse the repository at this point in the history
…r and visual editor (before the [/caption] closing tag)
aforcier authored and maxme committed Jul 8, 2016
1 parent 5474629 commit 4767334
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -463,8 +463,8 @@ public static String getContent(WPImageSpan imageSpan) {

if (!caption.equals("")) {
content = String.format(Locale.US,
"[caption id=\"\" align=\"%s\" width=\"%d\" caption=\"%s\"]%s[/caption]",
alignment, width, TextUtils.htmlEncode(caption), content);
"[caption id=\"\" align=\"%s\" width=\"%d\"]%s%s[/caption]",
alignment, width, content, TextUtils.htmlEncode(caption));
}
}

Original file line number Diff line number Diff line change
@@ -330,8 +330,8 @@ public String getImageHtmlForUrls(String fullSizeUrl, String resizedPictureURL,
fullSizeUrl, mediaTitle, alignmentCSS, resizedPictureURL);

if (!TextUtils.isEmpty(getCaption())) {
content = String.format("[caption id=\"\" align=\"%s\" width=\"%d\" caption=\"%s\"]%s[/caption]",
alignment, getWidth(), TextUtils.htmlEncode(getCaption()), content);
content = String.format("[caption id=\"\" align=\"%s\" width=\"%d\"]%s%s[/caption]",
alignment, getWidth(), content, TextUtils.htmlEncode(getCaption()));
}

return content;

0 comments on commit 4767334

Please sign in to comment.