feat: syntax highlighting of code section (#6236)
Co-authored-by: AdrieanKhisbe <adriean.khisbe@live.fr>
This commit is contained in:
@@ -5,12 +5,12 @@ import cx from "classnames"
|
||||
import { fromJS, Seq, Iterable, List, Map } from "immutable"
|
||||
import { getSampleSchema, fromJSOrdered, stringify } from "core/utils"
|
||||
|
||||
const getExampleComponent = ( sampleResponse, HighlightCode ) => {
|
||||
const getExampleComponent = ( sampleResponse, HighlightCode, getConfigs ) => {
|
||||
if (
|
||||
sampleResponse !== undefined &&
|
||||
sampleResponse !== null
|
||||
) { return <div>
|
||||
<HighlightCode className="example" value={ stringify(sampleResponse) } />
|
||||
<HighlightCode className="example" getConfigs={ getConfigs } value={ stringify(sampleResponse) } />
|
||||
</div>
|
||||
}
|
||||
return null
|
||||
@@ -150,7 +150,7 @@ export default class Response extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
let example = getExampleComponent( sampleResponse, HighlightCode )
|
||||
let example = getExampleComponent( sampleResponse, HighlightCode, getConfigs )
|
||||
|
||||
return (
|
||||
<tr className={ "response " + ( className || "") } data-code={code}>
|
||||
|
||||
Reference in New Issue
Block a user