This repository was archived by the owner on Nov 28, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +12
-24
lines changed Expand file tree Collapse file tree 4 files changed +12
-24
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ module.exports = (oas, apiSetting) => {
32
32
body : `
33
33
[block:textarea]
34
34
{
35
- "text": "This is text area"
35
+ "text": "# This is text area"
36
36
}
37
37
[/block]
38
38
[block:html]
@@ -82,7 +82,7 @@ module.exports = (oas, apiSetting) => {
82
82
1136,
83
83
"#9e918d"
84
84
],
85
- "caption": "doggo"
85
+ "caption": "* doggo* "
86
86
}
87
87
]
88
88
}
@@ -108,7 +108,7 @@ module.exports = (oas, apiSetting) => {
108
108
[block:parameters]
109
109
{
110
110
"data": {
111
- "0-0": "arbitrary",
111
+ "0-0": "* arbitrary* ",
112
112
"0-1": "info",
113
113
"0-2": "test",
114
114
"h-0": "test",
Original file line number Diff line number Diff line change 1
1
const React = require ( 'react' ) ;
2
2
const PropTypes = require ( 'prop-types' ) ;
3
- // const Marked = require('../lib/marked ');
3
+ const markdown = require ( '../lib/markdown ' ) ;
4
4
5
5
const ImageBlock = ( { block } ) => {
6
6
const myImage = block . data . images . map ( ( image , i ) => {
@@ -23,14 +23,8 @@ const ImageBlock = ({ block }) => {
23
23
</ a >
24
24
</ figure >
25
25
{ image . caption && (
26
- < figcaption >
27
- < p >
28
- {
29
- // TODO add marked
30
- image . caption
31
- }
32
- </ p >
33
- </ figcaption >
26
+ // eslint-disable-next-line react/no-danger
27
+ < figcaption dangerouslySetInnerHTML = { { __html : markdown ( image . caption ) } } />
34
28
) }
35
29
</ div >
36
30
) }
Original file line number Diff line number Diff line change 1
1
const React = require ( 'react' ) ;
2
2
const PropTypes = require ( 'prop-types' ) ;
3
- // import Marked from '../lib/marked' ;
3
+ const markdown = require ( '../lib/markdown' ) ;
4
4
5
5
const Parameters = ( { block } ) => {
6
6
const columns = block . data . cols ;
@@ -23,10 +23,8 @@ const Parameters = ({ block }) => {
23
23
24
24
for ( let c = 0 ; c < columns ; c += 1 ) {
25
25
tdCells . push (
26
- < div className = "td" key = { c } >
27
- { // TODO add marked
28
- block . data . data [ `${ r } -${ c } ` ] || '' }
29
- </ div > ,
26
+ // eslint-disable-next-line react/no-danger
27
+ < div className = "td" key = { c } dangerouslySetInnerHTML = { { __html : markdown ( block . data . data [ `${ r } -${ c } ` ] || '' ) } } />
30
28
) ;
31
29
}
32
30
return tdCells ;
Original file line number Diff line number Diff line change 1
- // import Marked from '../lib/marked';
2
1
const React = require ( 'react' ) ;
3
2
const PropTypes = require ( 'prop-types' ) ;
3
+ const markdown = require ( '../lib/markdown' ) ;
4
4
5
5
const Textarea = ( { block } ) => {
6
6
return (
7
- < div className = "magic-block-textarea" >
8
- {
9
- // TODO add marked
10
- block . text
11
- }
12
- </ div >
7
+ // eslint-disable-next-line react/no-danger
8
+ < div className = "magic-block-textarea" dangerouslySetInnerHTML = { { __html : markdown ( block . text ) } } />
13
9
) ;
14
10
} ;
15
11
You can’t perform that action at this time.
0 commit comments