1

I am upgrading a tinymce editor from version 5 to 6, and noticing that the tab key and space keys no longer work.

After the upgrade to v6, when TAB is pressed, only a single space is added in the editor. This is the code that handles tabs:

...
if (e.key === 'Tab') {
        if (e.shiftKey) {
        ...
        } else {
          this.insertContent('	');
          return false;
        }
      }
...

In version 5, when the above code was executed, you could use tab for aligning text (the cursor would jump to set positions in the editor). Does anyone know how to replicate this behavior in version 6?

*I want to emphasize that I want to retain the tab character for its alignment function, and inserting  s did not work.

I've tried the following approaches:

  • Add a <pre> tag around the inserted tab character. this worked for solving the single space issue but NOT the alignment.
  • Insert several consecutive &nbsp; characters. This allowed to insert consecutive whitespace, but also does not solve the alignment issue.
  • I tried using the nonbreaking_force_tab plugin, but that did not seem to change the behavior (still inserted a single space)
  • Tried the approach from this Stack Overflow answer: adding * {white-space: pre;} for content_css in the initialization.
pinrut27
  • 11
  • 1

0 Answers0