Skip to content

Commit

Permalink
(PDOC-30) Fix Markdown parsing lists parsing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iankronquist committed Jul 16, 2015
1 parent 16186ef commit 110526a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet_x/puppetlabs/strings/pops/yard_statement.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 110526a

Please sign in to comment.