Markdown-only composer: Kan regel tekst niet benadrukken met een vetgedrukt woord aan het einde

: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

https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/textarea-text-manipulation.js#L289

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

7 likes