Skip to content

Commit

Permalink
Minor IE fix when saving empty content
Browse files Browse the repository at this point in the history
  • Loading branch information
petrsloup committed Jun 22, 2016
1 parent e1a491a commit 2a9875b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions javascript/src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ klokantech.jekylledit.Editor = function(auth, config, category, repo,
goog.array.forEach(editables, function(editable) {
var sourceType = editable.getAttribute('data-jekylledit-source');
if (sourceType == 'content') {
langData['content'] = goog.global['toMarkdown'](editable.innerHTML);
langData['content'] =
goog.global['toMarkdown'](editable.innerHTML || ' ');
} else {
langData['metadata'][sourceType] = editable.textContent;
}
Expand Down Expand Up @@ -545,7 +546,8 @@ klokantech.jekylledit.Editor.prototype.save =
img.alt = langData['metadata']['title'] || ' ';
});

langData['content'] = goog.global['toMarkdown'](editable.innerHTML);
langData['content'] =
goog.global['toMarkdown'](editable.innerHTML || ' ');
} else {
langData['metadata'][sourceType] = editable.textContent;
}
Expand Down

0 comments on commit 2a9875b

Please sign in to comment.