leading tabs in code are now replaced with two spaces!
This commit is contained in:
parent
37aeba2247
commit
3b48e38cba
@ -136,7 +136,10 @@ class Rocco
|
|||||||
docs_blocks, code_blocks = [], []
|
docs_blocks, code_blocks = [], []
|
||||||
sections.each do |docs,code|
|
sections.each do |docs,code|
|
||||||
docs_blocks << docs.map { |line| line.sub(@comment_pattern, '') }.join("\n")
|
docs_blocks << docs.map { |line| line.sub(@comment_pattern, '') }.join("\n")
|
||||||
code_blocks << code.join("\n")
|
code_blocks << code.map do |line|
|
||||||
|
tabs = line.match(/^(\t+)/)
|
||||||
|
tabs ? line.sub(/^\t+/, ' ' * tabs.captures[0].length) : line
|
||||||
|
end.join("\n")
|
||||||
end
|
end
|
||||||
[docs_blocks, code_blocks]
|
[docs_blocks, code_blocks]
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user