Reset all inline marks before formatted text

Hi guys! I’d like to reset all inline marks before formatted text. Now it works now in a prosemirror example If there is some text before bold text, bold will not be applied to the new input If there is nothing before bold text (a cursor in the beginning of the row), bold will be applied

In my case I don’t have a menu panel and need to reset all mark implicitly, if a cursor is located in the beginning of the row

I have solved my issue

if ($cursor && $cursor.parentOffset === 0 && $cursor.marks().length) {
                    tr = tr.setStoredMarks([]);
   }

we check if the cursor is located in the beginning of the row and has any marks, then remove them all