0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Removed the default editor placeholder on edit

refs https://github.com/TryGhost/Team/issues/1206

- Because we allow <br> in the editor, the editor placeholder was remaining when editing (<p><br></p>). This clean the editor placeholder.
This commit is contained in:
Thibaut Patel 2021-11-17 18:26:34 +01:00
parent 042a772ebe
commit e6fa0bc449

View file

@ -415,6 +415,10 @@ export default Component.extend({
// inline markup that directly maps to HTML elements
getCleanHTML() {
if (this.editor && this.editor.element) {
if (this.editor.element.classList.contains('__has-no-content')) {
// Removes the default editor placeholder
return '';
}
return cleanBasicHtml(this.editor.element.innerHTML, {allowBr: true});
}
}