Skip to content

Commit

Permalink
Sets <p> margin to 0 for sent emails
Browse files Browse the repository at this point in the history
Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
  • Loading branch information
StCyr committed Feb 3, 2020
1 parent d7c1cdf commit 78ed1cc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/components/TextEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ export default {
onEditorReady(editor) {
const schema = editor.model.schema
// Set 0 pixel margin to all <p> elements
editor.conversion.for('downcast').add(dispatcher => {
dispatcher.on(
'insert:paragraph',
(evt, data, conversionApi) => {
const viewWriter = conversionApi.writer
viewWriter.setStyle('margin', '0', conversionApi.mapper.toViewElement(data.item))
},
{
priority: 'low',
}
)
})
schema.on(
'checkChild',
(evt, args) => {
Expand Down

0 comments on commit 78ed1cc

Please sign in to comment.