File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
Dnn.AdminExperience/ClientSide/Prompt.Web/src/components Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,9 @@ export class Output extends Component {
42
42
43
43
return result ;
44
44
}
45
- else if ( props . isHtml ) {
46
- return < TextLine key = { DomKey . get ( "output" ) } txt = { props . output } /> ;
47
- }
48
45
else if ( props . output ) {
49
- const style = props . isError ? "dnn-prompt-error" : `dnn-prompt-${ props . style === "cmd" ? "cmd" : "ok" } ` ;
50
- return < TextLine key = { DomKey . get ( "output" ) } txt = { props . output } css = { style } /> ;
46
+ const style = props . isHtml ? '' : props . isError ? "dnn-prompt-error" : `dnn-prompt-${ props . style === "cmd" ? "cmd" : "ok" } ` ;
47
+ return < TextLine key = { DomKey . get ( "output" ) } txt = { props . output } css = { style } isHtml = { props . isHtml } /> ;
51
48
}
52
49
}
53
50
Original file line number Diff line number Diff line change @@ -3,12 +3,13 @@ import PropTypes from "prop-types";
3
3
import Html from "./Html" ;
4
4
import DomKey from "../services/DomKey" ;
5
5
6
- const TextLine = ( { txt, css} ) => {
6
+ const TextLine = ( { txt, css, isHtml } ) => {
7
7
if ( ! txt ) {
8
8
return null ;
9
9
}
10
10
const textLines = txt . split ( "\\n" ) ;
11
- const rows = textLines . map ( ( line ) => line ? < span key = { DomKey . get ( "textline" ) } className = { css } > < Html html = { line } /> </ span > : null ) . reduce ( ( prev , current ) => {
11
+ const rows = textLines . map ( ( line ) => line ? < span key = { DomKey . get ( "textline" ) } className = { css } > { isHtml ? < Html html = { line } /> : line } </ span > : null )
12
+ . reduce ( ( prev , current ) => {
12
13
if ( current !== "" && current !== null && current !== undefined ) {
13
14
return [ ...prev , current ] ;
14
15
}
@@ -21,7 +22,8 @@ TextLine.defaultProps = { css: "dnn-prompt-cmd" };
21
22
22
23
TextLine . propTypes = {
23
24
txt : PropTypes . string . isRequired ,
24
- css : PropTypes . string
25
+ css : PropTypes . string ,
26
+ isHtml : PropTypes . bool
25
27
} ;
26
28
27
29
export default TextLine ;
You can’t perform that action at this time.
0 commit comments