File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
src/packages/frontend/components Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change 3
3
* License: MS-RSL – see LICENSE.md for details
4
4
*/
5
5
6
- import React from "react" ;
7
-
8
6
import { HTML } from "./html" ;
9
7
import { markdown_to_html } from "../markdown" ;
10
8
import { Props as HTMLProps } from "./html" ;
@@ -14,7 +12,7 @@ type Props = HTMLProps & {
14
12
line_numbers ?: boolean ;
15
13
} ;
16
14
17
- export const Markdown : React . FC < Props > = ( props ) => {
15
+ export function Markdown ( props : Props ) {
18
16
function to_html ( ) {
19
17
if ( ! props . value ) {
20
18
return ;
@@ -36,15 +34,13 @@ export const Markdown: React.FC<Props> = (props) => {
36
34
className = { props . className }
37
35
href_transform = { props . href_transform }
38
36
post_hook = { props . post_hook }
39
- safeHTML = { props . safeHTML }
37
+ safeHTML = { props . safeHTML ?? true }
40
38
reload_images = { props . reload_images }
41
39
smc_image_scaling = { props . smc_image_scaling }
42
- highlight_code = { props . highlight_code }
40
+ highlight_code = { props . highlight_code ?? true }
43
41
content_editable = { props . content_editable }
44
42
onClick = { props . onClick }
45
43
onDoubleClick = { props . onDoubleClick }
46
44
/>
47
45
) ;
48
- } ;
49
-
50
- Markdown . defaultProps = { safeHTML : true , highlight_code : true } ;
46
+ }
You can’t perform that action at this time.
0 commit comments