Fix simple glossary HTML not being escaped (#1788)

This commit is contained in:
toasted-nutbread 2021-07-03 10:46:51 -04:00 committed by GitHub
parent ca97e38bd2
commit d7c934cae8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -611,7 +611,7 @@ class TemplateRenderer {
_formatGlossary(context, dictionary, options) {
const data = options.data.root;
const content = options.fn(context);
if (typeof content === 'string') { return this._stringToMultiLineHtml(content); }
if (typeof content === 'string') { return this._stringToMultiLineHtml(this._escape(content)); }
if (!(typeof content === 'object' && content !== null)) { return ''; }
switch (content.type) {
case 'image': return this._formatGlossaryImage(content, dictionary, data);