twill icon indicating copy to clipboard operation
twill copied to clipboard

Clean Button missing in the Tiptap editor

Open ConstantMath opened this issue 1 year ago • 3 comments

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

ConstantMath avatar Mar 12 '24 11:03 ConstantMath

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

Tofandel avatar Jun 05 '24 16:06 Tofandel

Quill does and it removes formatting on the selected text.

ifox avatar Jun 05 '24 18:06 ifox

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

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

Tofandel avatar Jun 05 '24 18:06 Tofandel