replace html entities in comment.orig

This commit is contained in:
igoradamenko
2018-05-26 18:35:32 +03:00
parent f468b7c3ee
commit 78b9a109f4
+6
View File
@@ -286,6 +286,12 @@ export default class Comment extends Component {
)
),
time: formatTime(new Date(data.time)),
orig: isEditing && data.orig && data.orig
.replace(/&[#A-Za-z0-9]+;/gi, entity => {
const span = document.createElement('span');
span.innerHTML = entity;
return span.innerText;
}),
score: {
value: Math.abs(score),
sign: score > 0 ? '+' : (score < 0 ? '' : null),