verbb / vizy

A flexible visual editor for Craft CMS
Other
44 stars 8 forks source link

Trim Empty Nodes #25

Closed kerns closed 3 years ago

kerns commented 3 years ago

Some sort of trimEmptyNodesOnSave pref would be very nice if possible, and not dangerous. Most editors won't notice this empty p tag ...not on the backend nor the frontend. >--- ☹️--------<

Screen Shot 2021-05-21 at 17 21 29
engram-design commented 3 years ago

Sure, certainly will mark this as an opt-in thing, as I've come across many clients who want to create a bit more space with line breaks. Right or wrong, it's a common enough thing to warrant both options here.

kerns commented 3 years ago

If they are indeed line breaks and not empty p tags that would make sense/feel better.

engram-design commented 3 years ago

They're considered the same thing with ProseMirror/Tiptap, so maybe that'll be an issue. Or a hard break can contain a <br> so it's considered non-empty.

engram-design commented 3 years ago

Added a new field setting to control this for the next release. To get this early, change your verbb/vizy requirement in composer.json to:

"require": {
  "verbb/vizy": "dev-craft-3 as 1.0.2",
  "...": "..."
}

Then run composer update.

engram-design commented 3 years ago

Added in 1.0.3