From 110526a203af4db4f2051c047dc0b15951b1d969 Mon Sep 17 00:00:00 2001 From: Ian Kronquist Date: Thu, 16 Jul 2015 10:46:39 -0700 Subject: [PATCH] (PDOC-30) Fix Markdown parsing lists parsing The transformer comment matching regex matched all whitespace after a comment. Lines which were effectively "blank" and just had a comment would be erased. Markdown lists need to end with a blank line. This messed up markdown formatting. The culprit is the regex /^\s*#\s/ which matches all of the comment ' #\n', however we want to leave the newline alone for markdown to parse. We replace the regex with /^\s*#[ \t]/ which will only match tabs or spaces after the hash and leave our beloved newline alone. --- lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb b/lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb index 927131916..2e40858e7 100644 --- a/lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb +++ b/lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb @@ -58,7 +58,7 @@ def extract_comments # FIXME: The gsub trims comments, but is extremely optimistic: It # assumes only one space separates the comment body from the # comment character. - comments.unshift line.gsub(/^\s*#\s/, '') + comments.unshift line.gsub(/^\s*#[ \t]/, '') else # No comment found on this line. We must be done piecing together a # comment block.