yydcdut / RxMarkdown

:fax:Markdown for Android, supports TextView && EditText (Live Preview), supports code high light.
749 stars 93 forks source link

Gives error in List #50

Closed shubhsherl closed 6 years ago

shubhsherl commented 6 years ago

When pressing Enter in Ordered/Unordered List with no text, it should delete List. But its giving java.lang.StringIndexOutOfBoundsException

This happens when I do this at the end of my Editor.

shubhsherl commented 6 years ago

The Problem is that in onTextChanged() function the value of start is greater than the length of CharSequence. This is mainly because of deleteUnorderedListByEnter() and deleteOrderedListByEnter() is calling both beforeTextChanged() and onTextChanged() with same Charsequence.