Fixed new line being included in bold/italic in GFM form
What does this MR do?
When selecting a line that has the last character as a new line it would mess around the markdown & therefore causing the bold & italic characters to be on new lines. This fixes that by removing the last new line from the selection & then adding in the markdown characters.
Screenshots (if relevant)
What are the relevant issue numbers?
Closes #25456 (closed)