Skip to content

Commit

Permalink
fix: renders Markdown in all description fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Sporiff authored Jun 4, 2024
1 parent 6a926b2 commit e5a2907
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { isParameterWithSchemaObject } from '../../libs/schemaObject'
import Content from '../Content.astro'
import Items from '../Items.astro'
import Key from '../Key.astro'
import Md from '../Md.astro'
import Schema from '../schema/Schema.astro'
import Text from '../Text.astro'
interface Props {
parameter: Parameter
Expand All @@ -20,12 +20,12 @@ const { parameter } = Astro.props
isOpenAPIV2Items(parameter) ? (
<>
<Items items={parameter} />
<Text>{parameter.description}</Text>
<Md text={parameter.description} />
</>
) : parameter.content ? (
<>
<Content content={parameter.content} />
<Text>{parameter.description}</Text>
<Md text={parameter.description} />
</>
) : isParameterWithSchemaObject(parameter) ? (
<Schema
Expand Down
6 changes: 3 additions & 3 deletions packages/starlight-openapi/components/schema/Schema.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import { isSchemaObjectObject, type SchemaObject as SchemaObjectType } from '../../libs/schemaObject'
import Examples, { type Props as ExamplesProps } from '../example/Examples.astro'
import Text from '../Text.astro'
import Md from '../Md.astro'
import SchemaObject from './SchemaObject.astro'
Expand All @@ -16,7 +16,7 @@ const { description, example, examples, schema } = Astro.props
const isObject = schema && isSchemaObjectObject(schema)
---

{isObject && <Text>{description}</Text>}
{isObject && <Md text={description} />}
{schema && <SchemaObject schemaObject={schema} hideExample={example !== undefined || examples !== undefined} />}
{!isObject && <Text>{description}</Text>}
{!isObject && <Md text={description} />}
<Examples example={example} examples={examples} />

0 comments on commit e5a2907

Please sign in to comment.