-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
It appears that internally, quill appends a trailing newline character to the text model. This trailing new line character is not displayed to the user in the editor, nor can it be added to the editor's selection via the setSelection method. The trailing new line character is, however, returned in getText and getContents, and it is counted in getLength. This is a little confusing for programmatic use, when trying to verify the contents of the editor after setting them via the api, for instance.
Steps for Reproduction
- Visit quilljs.com.
- Pause js execution.
- Set the text of the
quillinstance to a string viasetText. - Get the text of the
quillinstance viagetText. - Verify that the text is set correctly using string equality.
Example:
Expected behavior: The new line character is stripped/ignored in return values from API calls.
Actual behavior: The new line character is returned/counted in return values from API calls.
Platforms: n/a
Version: 1.0.0-rc.2
It is entirely possible that there is a good use for exposing this newline character externally, but I have not been able to find reference to it in issues or documentation. Thanks!
