inveniosoftware / inveniosoftware/react-invenio-forms

TinyMCE wraps content in a paragraph

Open
#261 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
2
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Package version (if known): [v4.3.0](https://github.com/inveniosoftware/react-invenio-forms/releases/tag/v4.3.0)

## Describe the bug
TinyMCE which was added with #222 uses a `

` element as a root element as a default block element. It injects this element into the content.

Before version 6 of TinyMCE this could be tampered with using the [`forced_root_block`](https://www.tiny.cloud/docs/tinymce/latest/content-filtering/#forced_root_block) configuration parameter. But now it can only by used to change what element is used. There is a [lengthy discussion](https://github.com/tinymce/tinymce/discussions/7342) about possible workarounds.

As far as I can tell, every time a description field is changed using the editor, provided there is not already a root element, one will be added.

As a side note (I saw @ntarocco mention this on discord) apparently there are possible issues with the licensing of TinyMCE (see [here](https://github.com/tinymce/tinymce/issues/9453)).

## Steps to Reproduce
1. Create a new record
2. Make sure to not use any html or styling in the description, just write text
3. Look up the record on the API, it will be nested in a paragraph.

## Expected behavior
The editor should not inject markup.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.