'Can I dynamically remove a class set by a library?

I am using react-quill to add a text formatter in my application. The library add classes to li tags if it finds indentation. Below is an example:

   <ul>
      <li>First</li>
      <li class="ql-indent-1">Sub  First</li>
      <li class="ql-indent-2">Sub sub first</li>
   </ul>

The result will be as below

     - First
       - Sub First
         - Sub sub first

Basically based on the classes, the library adds the indentation. I want to dynamically remove ql-indent-2. If the user presses tab for second level bullet point, no class should be added instead of ql-indent-2 being appended to class. Is this possible?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source