Skip to content

Wrong enclosure for data type with multiple lines at markdown #223

Closed
@crazymind1337

Description

@crazymind1337

Describe the Bug

If I add a data type with mutliple line, it will be enclosured with single "`" (inline code section) instead of tripple "`" (multi-line code fences). This causes a strange view at a markdownv viewer.

Expected Behavior

It should be enclosed with \n<text>\n

Expected result:

Alias of

\```
Hash[Pattern[/^[a-z][a-z0-9_-]*$/], Struct[
    {
      param1 => String[1],
      param2 => Stdlib::Absolutepath,
      paramX => Boolean,
    }
  ]
]
\```

Steps to Reproduce

Steps to reproduce the behavior:

  1. add a custom data type, e.g.:
# summary Test Type
#
type Test_module::Test_type = Hash[
  Pattern[/^[a-z][a-z0-9_-]*$/],
  Struct[
    {
      param1 => String[1],
      param2 => Stdlib::Absolutepath,
      paramX => Boolean,
    }
  ]
]
  1. generate the REFERENCE.md:
puppet strings generate --format markdown --out REFERENCE.md
  1. check the result, it will be like:
Alias of `Hash[Pattern[/^[a-z][a-z0-9_-]*$/], Struct[
    {
      param1 => String[1],
      param2 => Stdlib::Absolutepath,
      paramX => Boolean,
    }
  ]]`

Environment

  • Gem puppet-strings (2.3.1)
  • Platform MacOS 10.15.3 (19D76)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions