I am setting up an application and At GUI side, I would like to display the textcomment in different lines rather than in one single line.
currently it works as follows:
1. From backend json file is received which has key:value pair for comment.
Example->
Comment: "Application Entity Title for Service.
The sending system must use exactly the same name to send data to service.
- At GUI side, after parsing the JSON file, GUI tries to display the comment.
Issue: GUI is not recognizing the HTML tag
and not displaying a line break.
Question: do I need to handle it in the backend(in C#) in a different way?
json received from backend:
Comment: "Application Entity Title for Service.<br/> The sending system must use exactly the same name to send data to service. <br/>"
GUI react code
<div className="Setting__Comment">
<p>
<strong>Description: </strong>
{node.Comment}
</p>
</div>
Current Result at GUI side
Description: Application Entity Title for Service.<br/> The sending system must use exactly the same name to send data to service. <br/>
Expected Results.
Description: Application Entity Title for Service.
The sending system must use exactly the same name to send data to
service.
Solution which worked for me:
displayComment(){
var node = this.props.treeNode;
return {__html: node.Comment};
<div className="SettingsTreeValueNode__Comment">
<p>
<strong>Description: </strong>
<div dangerouslySetInnerHTML={this.displayComment()}/>
</p>
</div>
</div>
` means is it coming in the `node.Comment` or from somewhere else? – Vikas Singh Apr 26 '19 at 08:26
Description: