ueberdosis / tiptap-php

A PHP package to work with Tiptap content
https://tiptap.dev
MIT License
185 stars 29 forks source link

Add isEmpty() method to check for empty Tiptap content #51

Open putrafajarh opened 1 month ago

putrafajarh commented 1 month ago

Background

Currently, there's no straightforward way to check if the content of a Tiptap editor is empty. This can be particularly useful for form validation or preventing submission of empty content.

Proposed Solution

Implement an isEmpty() method for Tiptap that returns a boolean value indicating whether the editor's content is empty or not.

Expected Behavior

Use Case

This method would be helpful in scenarios such as:

putrafajarh commented 1 month ago

FYI, there is editor.isEmpty on tiptapjs