Skip to content

Commit d81d4c2

Browse files
committed
Allow numerics for templates using code_maybe_block
A number of ERB templates use the code_maybe_block method to assist with formatting. This fails if the value being passed is not a string, such as an integer default value for a resource type.
1 parent 5291b8f commit d81d4c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/puppet-strings/markdown/helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module PuppetStrings::Markdown::Helpers
1212
# @param [String] inline_prefix String to insert before if it’s inline.
1313
# @returns [String] Markdown
1414
def code_maybe_block(code, type: :puppet, block_prefix: "\n\n", inline_prefix: ' ')
15-
if code.include?("\n")
15+
if code.to_s.include?("\n")
1616
"#{block_prefix}```#{type}\n#{code}\n```"
1717
else
1818
"#{inline_prefix}`#{code}`"

0 commit comments

Comments
 (0)