fix #1104 ignore empty content
This commit is contained in:
parent
58563b4bc2
commit
144518a811
1 changed files with 12 additions and 6 deletions
|
@ -694,18 +694,24 @@ public class FessXpathTransformer extends XpathTransformer implements FessTransf
|
|||
// meta thumbnail
|
||||
final Node thumbnailNode = getXPathAPI().selectSingleNode(document, META_NAME_THUMBNAIL_CONTENT);
|
||||
if (thumbnailNode != null) {
|
||||
final URL thumbnailUrl = getURL(responseData.getUrl(), thumbnailNode.getTextContent());
|
||||
if (thumbnailUrl != null) {
|
||||
return thumbnailUrl.toExternalForm();
|
||||
final String content = thumbnailNode.getTextContent();
|
||||
if (StringUtil.isNotBlank(content)) {
|
||||
final URL thumbnailUrl = getURL(responseData.getUrl(), content);
|
||||
if (thumbnailUrl != null) {
|
||||
return thumbnailUrl.toExternalForm();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// meta og:image
|
||||
final Node ogImageNode = getXPathAPI().selectSingleNode(document, META_PROPERTY_OGIMAGE_CONTENT);
|
||||
if (ogImageNode != null) {
|
||||
final URL thumbnailUrl = getURL(responseData.getUrl(), ogImageNode.getTextContent());
|
||||
if (thumbnailUrl != null) {
|
||||
return thumbnailUrl.toExternalForm();
|
||||
final String content = ogImageNode.getTextContent();
|
||||
if (StringUtil.isNotBlank(content)) {
|
||||
final URL thumbnailUrl = getURL(responseData.getUrl(), content);
|
||||
if (thumbnailUrl != null) {
|
||||
return thumbnailUrl.toExternalForm();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue