remove-markdown icon indicating copy to clipboard operation
remove-markdown copied to clipboard

Wrong result when using multiple italic markdown in a sequence separated by space

Open maheshkumarsoni opened this issue 1 year ago • 1 comments

Problem Statement:

  • The issue is when we have a sequential ‘_' (underscore) character after a space the package will replace the underscore from the only first word! Example: ‘Wizard with a gun' -> Wizard with a gun

  • Here 'Wizard’ and 'with’ both are separated by space and have an underscore around them so when we parse the string with the remove-markdown npm package it parses the first word. due to the next word being exactly after a space. Hence, it's not able to identify that word as a Markdown character!

Screenshot 2023-12-28 at 4 32 55 PM

Solution:

  • For now, I've fixed this with a workaround code to break this sequence by manipulating the string to replace the _ _ sequence and fix the markdown below is the example code snippet I tried:

Screenshot 2023-12-28 at 4 50 40 PM

maheshkumarsoni avatar Dec 28 '23 11:12 maheshkumarsoni