diff --git a/README.md b/README.md index ac4eb55..38c066c 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,10 @@ pell.init({ // Use the output html, triggered by element's `oninput` event onChange: html => console.log(html), + // , optional, default = 'div' + // Instructs the editor which element to inject via the return key + defaultParagraphSeparator: 'div', + // , optional, default = false // Outputs instead of styleWithCSS: false, @@ -195,6 +199,7 @@ const editor = pell.init({ document.getElementById('text-output').innerHTML = html document.getElementById('html-output').textContent = html }, + defaultParagraphSeparator: 'p', styleWithCSS: true, actions: [ 'bold', diff --git a/demo.html b/demo.html index 31870c5..86f49f8 100644 --- a/demo.html +++ b/demo.html @@ -50,6 +50,7 @@

HTML output:

var editor = window.pell.init({ element: document.getElementById('pell'), + defaultParagraphSeparator: 'p', styleWithCSS: false, onChange: function (html) { document.getElementById('text-output').innerHTML = html diff --git a/src/pell.js b/src/pell.js index e256a80..ccd2584 100644 --- a/src/pell.js +++ b/src/pell.js @@ -138,6 +138,7 @@ export const init = settings => { actionbar.appendChild(button) }) + if (settings.defaultParagraphSeparator) exec('defaultParagraphSeparator', settings.defaultParagraphSeparator) if (settings.styleWithCSS) exec('styleWithCSS') return settings.element