fix: address a minor isssue when there is content after last asterisk/underscore

This commit is contained in:
Andrei Dolgov 2022-09-27 16:38:18 -04:00
parent 6a902a2b21
commit a8cb58cb4a

View File

@ -49,7 +49,7 @@ ShortcutEventHandler doubleAsterisksToBold = (editorState, event) {
..formatText(
textNode,
thirdToLastAsteriskIndex,
selection.end.offset - thirdToLastAsteriskIndex - 2,
selection.end.offset - thirdToLastAsteriskIndex - 3,
{
BuiltInAttributeKey.bold: true,
BuiltInAttributeKey.defaultFormating: true,
@ -115,7 +115,7 @@ ShortcutEventHandler doubleUnderscoresToBold = (editorState, event) {
..formatText(
textNode,
thirdToLastUnderscoreIndex,
selection.end.offset - thirdToLastUnderscoreIndex - 2,
selection.end.offset - thirdToLastUnderscoreIndex - 3,
{
BuiltInAttributeKey.bold: true,
BuiltInAttributeKey.defaultFormating: true,