Titor8115 / mandown

man-page inspired Markdown viewer
GNU General Public License v3.0
243 stars 13 forks source link

fix bug where whitespace after a codespan would be ignored #39

Closed an-prata closed 1 year ago

an-prata commented 1 year ago

Fixes a small bug in which a space immediately following a codespan would be dropped from mandown's output. This PR is admittedly not the most elegant piece of code but it fixes it pretty well by making markdown.c's static char_codespan() function check to see if a space immediately follows the code span, and if so moves the space into the code span.

Before: image After: image

No changes where made to the output of mandown on the sample document.

Titor8115 commented 1 year ago

Don't worry about the elegance. I'm still embraced by my spaghetti pager code. Thanks for the fix! I'll do some verification and performance test this weekend and merge the pull. You might also wanna open a pull request at https://github.com/vmg/sundown , though they are probably no longer active