Skip to content

Is it possible to escape HTML so I can use MDX in descriptions?Β #993

Open
@Preston-Landers

Description

@Preston-Landers

I want to reuse a common component (MDX) in several areas of my OpenAPI spec as shown in the example below.

The <b> tags are getting passed through, but the < in <UnderConstruction /> is getting transformed to &lt; UnderConstruction />, which of course makes the component not render as desired. And <blink> doesn't work, sadly. So it seems like maybe there's a whitelist of allowed tags.

Is there an escape hatch if I want to get crazy and put MDX components in my OpenAPI description fields?

api-keys-delete:
  post:
    summary: Delete API Keys
    description: |
      Delete one or more API keys by their internal ID.

      <blink>Hello</blink>, <b>world</b>!

      import UnderConstruction from '../partials/\_under-construction.mdx'

      <UnderConstruction />

Gets translated to this MDX:

<MethodEndpoint
  method={"post"}
  path={"/api_keys/delete_api_keys"}
  context={"endpoint"}
>
</MethodEndpoint>


Delete one or more API keys by their internal ID.

<blink&gt;Hello</blink&gt;, <b>world</b>!

import UnderConstruction from '../partials/\_under-construction.mdx'

&lt;UnderConstruction />

Metadata

Metadata

Assignees

Labels

reviewing πŸ‘€Undergoing manual audit to determine if issue should still be active

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions