mirror of
https://github.com/codex-team/editor.js
synced 2024-06-04 15:02:42 +02:00
return empty text instead of undefined (#141)
* return empty text instead of undefined * upd
This commit is contained in:
parent
44b31c16b7
commit
c4f19d5c59
|
@ -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;
|
||||
|
|
|
@ -617,7 +617,7 @@ var image = (function(image) {
|
|||
height : image.height,
|
||||
additionalData :null
|
||||
},
|
||||
caption : caption.innerHTML,
|
||||
caption : caption.innerHTML || '',
|
||||
cover : null
|
||||
};
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue