Trim comment characters from docstrings
A very naive attempt. Simple removes any leading whitespace, the comment character and then one space.
This commit is contained in:
parent
66af766dba
commit
9ef57b594e
|
@ -51,7 +51,10 @@ module Puppetx::Yardoc::Pops
|
||||||
|
|
||||||
source_text.slice(0, line-1).reverse.each do |line|
|
source_text.slice(0, line-1).reverse.each do |line|
|
||||||
if COMMENT_PATTERN.match(line)
|
if COMMENT_PATTERN.match(line)
|
||||||
comments.unshift line
|
# 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/, '')
|
||||||
else
|
else
|
||||||
# No comment found on this line. We must be done piecing together a
|
# No comment found on this line. We must be done piecing together a
|
||||||
# comment block.
|
# comment block.
|
||||||
|
|
Loading…
Reference in New Issue