Mermade / widdershins

OpenAPI / Swagger, AsyncAPI & Semoasa definitions to (re)Slate compatible markdown
https://mermade.github.io/reslate
MIT License
1.5k stars 322 forks source link

Multiline markdown in response examples breaks table in Markdown #561

Open dustinmoris opened 8 months ago

dustinmoris commented 8 months ago

Describe the bug

According to the OpenAPI v3 specification CommonMark may be used for the description field of a response object.

Example:

      responses:
        '201':
          description: |
            Foo bar:
              - item 1
              - item 2
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FooBar'

However, when generating docs from a specification like this then the Markdown table which describes the possible responses is broken because Markdown cells must be single line.

I think this is very similar to this issue which was already reported in the past: https://github.com/Mermade/widdershins/issues/211

Expected behavior

Flatten the contents of the table cells using HTML (e.g. <br>, etc).

Screenshots

image

Versions:

"widdershins": "^4.0.1"