Escape HTML chars in composer highlights
This is very embarrassing, I know
This commit is contained in:
parent
37c784dad2
commit
b6c4045cb4
|
@ -133,7 +133,14 @@ const SCAN_RE = new RegExp(
|
|||
|
||||
function highlightText(text, { maxCharacters = Infinity }) {
|
||||
// Accept text string, return formatted HTML string
|
||||
let html = text;
|
||||
// Escape all HTML special characters
|
||||
let html = text
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, ''');
|
||||
|
||||
// Exceeded characters limit
|
||||
const { composerCharacterCount } = states;
|
||||
let leftoverHTML = '';
|
||||
|
|
Loading…
Reference in a new issue