Decode feed item title as html

Decode feed item title as html to handle special characters such as &
This commit is contained in:
AbhishekGarg 2020-06-27 16:07:30 +05:30
parent ea21470dcd
commit ee0eca62dd
1 changed files with 8 additions and 2 deletions

View File

@ -171,7 +171,13 @@ export default class RssReader extends React.Component<IRssReaderProps, IRssRead
private _onConfigure() {
this.props.propertyPane.open();
}
private decodeHtml(html) {
var txt = document.createElement("textarea");
txt.innerHTML = html;
return txt.value;
}
/*
_onReaderListRow used by Default feed Layout
*/
@ -193,7 +199,7 @@ export default class RssReader extends React.Component<IRssReaderProps, IRssRead
target={this.props.titleLinkTarget ? this.props.titleLinkTarget : "_self"}
style={this.props.fontColor ? {color: this.props.fontColor} : {}}
>
{thisItem.title}
{this.decodeHtml(thisItem.title)}
</Link>
</div>