Closed ashfurrow closed 8 years ago
@rpowelll Are you available to look this over? No worries at all, I know you're busy!
It might be a good idea to add a test to ensure we're not stripping newlines from inside comment blocks as well since in Markdown those can be syntactically significant. My general rule is to over-test any time you use regular expressions since they tend to be fragile and introduce regressions.
That's a good idea!
👍 looks good
Fixes #20.
Regexes gave me trouble for stripping lines like
I originally used
squeeze("\n")
but that strips consecutive newlines in code, which is not good (I added a test for that). So my solution was tosplit
based on a regex that used\n*
and thenjoin
. The problem is that this adds a newline before any matched components, so I make sure to remove newlines preceding//:
comments after that check. Let me know what you think, I'm sure there's a better solution.