0

I am using a rich text area that TinyMCE offers in a self hosted solution. When I add a bulleted list and add a new item, the text <br data-mce-bogus="1"> is added to the mark up. I don't want this.

enter image description here

and the markup on the page...

enter image description here

Why is TinyMCE adding this and can anyone help with how to remove it?

dstewart101
  • 1,084
  • 1
  • 16
  • 38

2 Answers2

0

If you use the TinyMCE APIs to extract the content (getContent()) you should not see that <br data-mce-bogus="1">.

That <br> is an internal marker (TinyMCE uses a variety of them) and none of the internal markers are returned when using TinyMCE's APIs to extract the content.

Michael Fromin
  • 13,131
  • 2
  • 20
  • 31
  • Thanks, what do you mean by "extract the content". I'm creating a bullet list with the bullet list button, and the typing something so that i have a bulleted list. Everytime I press return to create a new list item, a list item is created with the markup as above. I don't know what I would be doing outside of normal usage here. Further if I set the cursor beside the empty bullet list, I can't seem to delete the bullet point by pressing the backspace key. However, if I position the cursor at the last line of the previous bullet list item and press the `DELETE` key, it deletes. – dstewart101 May 16 '23 at 08:41
0

Adding 'lists' to the configuration of the TinyMCE text area was enough to solve all my woes.

For example,

tinymce.init({
    selector: "textarea.mceEditor",
    content_css: 'style.css',
    plugins: 'lists',
dstewart101
  • 1,084
  • 1
  • 16
  • 38