return empty text instead of undefined (#141)

* return empty text instead of undefined

* upd
This commit is contained in:
khaydarov 2017-01-30 20:37:47 +03:00 committed by Peter Savchenko
parent 44b31c16b7
commit c4f19d5c59
5 changed files with 9 additions and 9 deletions

View file

@ -113,7 +113,7 @@ var header = (function(header) {
var data = {
"heading-styles": blockContent.dataset.headerData,
"format": "html",
"text": blockContent.textContent
"text": blockContent.textContent || ''
};
return data;

View file

@ -617,7 +617,7 @@ var image = (function(image) {
height : image.height,
additionalData :null
},
caption : caption.innerHTML,
caption : caption.innerHTML || '',
cover : null
};

View file

@ -325,10 +325,10 @@ var link = (function(link) {
var data = {
url : blockContent.querySelector("." + linkElement).href,
shortLink : blockContent.querySelector("." + linkElement).textContent,
image : blockContent.querySelector("." + settings.elementClasses.image).src,
title : blockContent.querySelector("." + settings.elementClasses.title).textContent,
description : blockContent.querySelector("." + settings.elementClasses.description).textContent
shortLink : blockContent.querySelector("." + linkElement).textContent || '',
image : blockContent.querySelector("." + settings.elementClasses.image).src || '',
title : blockContent.querySelector("." + settings.elementClasses.title).textContent || '',
description : blockContent.querySelector("." + settings.elementClasses.description).textContent || ''
};
return data;

View file

@ -481,8 +481,8 @@ var quote = (function(quote) {
var outputData = {
"text" : parsedblock.text,
"format" : "html",
"cite" : parsedblock.author,
"caption": parsedblock.job,
"cite" : parsedblock.author || '',
"caption": parsedblock.job || '',
"size" : parsedblock.style,
"image" : parsedblock.photo
};

View file

@ -213,7 +213,7 @@ var twitter = (function(twitter) {
text: blockContent.dataset.text,
created_at: blockContent.dataset.createdAt,
status_url: blockContent.dataset.statusUrl,
caption: caption.innerHTML
caption: caption.innerHTML || ''
};
return data;