Render object descriptions as Markdown.

This commit is contained in:
Mark H. Wilkinson
2017-06-13 17:13:33 +01:00
parent 99a525eac2
commit db57ee0dfe

View File

@@ -40,6 +40,7 @@ class ObjectModel extends Component {
let additionalProperties = schema.get("additionalProperties") let additionalProperties = schema.get("additionalProperties")
let title = schema.get("title") || name let title = schema.get("title") || name
let required = schema.get("required") let required = schema.get("required")
const Markdown = getComponent("Markdown")
const JumpToPathSection = ({ name }) => <span className="model-jump-to-path"><JumpToPath path={`definitions.${name}`} /></span> const JumpToPathSection = ({ name }) => <span className="model-jump-to-path"><JumpToPath path={`definitions.${name}`} /></span>
let collapsedContent = (<span> let collapsedContent = (<span>
<span>{ braceOpen }</span>...<span>{ braceClose }</span> <span>{ braceOpen }</span>...<span>{ braceClose }</span>
@@ -66,7 +67,9 @@ class ObjectModel extends Component {
{ {
!description ? null : <tr style={{ color: "#999", fontStyle: "italic" }}> !description ? null : <tr style={{ color: "#999", fontStyle: "italic" }}>
<td>description:</td> <td>description:</td>
<td>{ description }</td> <td>
<Markdown source={ description } />
</td>
</tr> </tr>
} }
{ {