Markdown-only composer: Can't emphasize line of text with a bold word at the end

:information_source: Overview

In the Markdown-only composer (i.e. not the new composer mode we’re currently testing on Meta), when trying to italicize a line of text where the last word of that text is bolded, the first letter is removed from the line, and the * is removed from the end, and the line does not get converted to italics.

:walking_woman: Steps to reproduce

  1. In the Markdown-only composer, write a line where the last word is bolded, e.g.
This is a super edge case where the last word in a sentence is **bolded.**
  1. Highlight the line and use CMD+I or the toolbar shortcut to italicize.

:white_check_mark: Expected results

The line should read:

*This is a super edge case where the last word in a sentence is **bolded.***

:x: Observed results

The line reads:

his is a super edge case where the last word in a sentence is **bolded.*

:books: Additional context

3 Likes

I checked it and found that the error should be in this line

It does not detect the marks on both sides, but only detects the mark on the right (tail). If a mark appears on the right side of the selected text, it enters the deletion block

This means something** will become mething by pressing ctrl + b

Made a PR to fix it

6 Likes