Skip to content

Commit 2a9875b

Browse files
committed
Minor IE fix when saving empty content
1 parent e1a491a commit 2a9875b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

javascript/src/editor.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ klokantech.jekylledit.Editor = function(auth, config, category, repo,
139139
goog.array.forEach(editables, function(editable) {
140140
var sourceType = editable.getAttribute('data-jekylledit-source');
141141
if (sourceType == 'content') {
142-
langData['content'] = goog.global['toMarkdown'](editable.innerHTML);
142+
langData['content'] =
143+
goog.global['toMarkdown'](editable.innerHTML || ' ');
143144
} else {
144145
langData['metadata'][sourceType] = editable.textContent;
145146
}
@@ -545,7 +546,8 @@ klokantech.jekylledit.Editor.prototype.save =
545546
img.alt = langData['metadata']['title'] || ' ';
546547
});
547548

548-
langData['content'] = goog.global['toMarkdown'](editable.innerHTML);
549+
langData['content'] =
550+
goog.global['toMarkdown'](editable.innerHTML || ' ');
549551
} else {
550552
langData['metadata'][sourceType] = editable.textContent;
551553
}

0 commit comments

Comments
 (0)