area17 / twill

Twill is an open source CMS toolkit for Laravel that helps developers rapidly create a custom admin console that is intuitive, powerful and flexible. Chat with us on Discord at https://discord.gg/cnWk7EFv8R.
https://twillcms.com
Apache License 2.0
3.63k stars 560 forks source link

Clean Button missing in the Tiptap editor #2534

Open ConstantMath opened 4 months ago

ConstantMath commented 4 months ago

Description

Contrary to what is mentioned in the doc, 'clean' button is not present on Tiptap toolbar.

https://github.com/area17/twill/blob/3.x/frontend/js/components/WysiwygTiptap.vue

Steps to reproduce

Add 'clean' to the 'toolbar-options' attribute.

Expected result

Clean button present in the toolbar

Actual result

No clean button Screenshot 2024-03-12 at 12 39 11

Versions

Twill version: 3.1

Tofandel commented 1 month ago

What would the "clean" button achieve? I think it's just a mistake in the doc, because nor the Quill or the TipTap editor have a clean button available

ifox commented 1 month ago

Quill does and it removes formatting on the selected text.

Tofandel commented 1 month ago

I see, then to achieve the same in tiptap we need a button that runs

editor
  .chain()
  .focus()
  .clearNodes()
  .unsetAllMarks()
  .run()