Brickster / pretty-markdown

Sublime Text plugin for beatifying a markdown file when saving.
MIT License
0 stars 0 forks source link

convert_bolds is confused when both bold and italics use the same character #8

Closed Brickster closed 10 years ago

Brickster commented 10 years ago

When trying to convert bolds in

___bold and italic___

the output is

**_bold and italics**_

The expected result would either convert the inner two underscores or the outer two.

Brickster commented 10 years ago

The issue was that the regex was ungreedy when capturing the final two characters (\ or __). The initial implementation was supposed to capture the innermost bold characters. The regex to fix this issue was simpler when capturing the outermost so that's the expected output now. The tests have been updated to reflect this fact.