mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Merge pull request #2392 from alexandrevryghem/fix-mathjax-displaying-twiced-in-ui_contribute-maintenance-7.6
[Port dspace-7_x] Fixed MathJax code being displayed twice by `dsMarkdown` pipe
This commit is contained in:
@@ -67,7 +67,9 @@ export class MarkdownPipe implements PipeTransform {
|
|||||||
// sanitize-html doesn't let through SVG by default, so we extend its allowlists to cover MathJax SVG
|
// sanitize-html doesn't let through SVG by default, so we extend its allowlists to cover MathJax SVG
|
||||||
allowedTags: [
|
allowedTags: [
|
||||||
...sanitizeHtml.defaults.allowedTags,
|
...sanitizeHtml.defaults.allowedTags,
|
||||||
'mjx-container', 'svg', 'g', 'path', 'rect', 'text'
|
'mjx-container', 'svg', 'g', 'path', 'rect', 'text',
|
||||||
|
// Also let the mjx-assistive-mml tag (and it's children) through (for screen readers)
|
||||||
|
'mjx-assistive-mml', 'math', 'mrow', 'mi',
|
||||||
],
|
],
|
||||||
allowedAttributes: {
|
allowedAttributes: {
|
||||||
...sanitizeHtml.defaults.allowedAttributes,
|
...sanitizeHtml.defaults.allowedAttributes,
|
||||||
@@ -88,7 +90,16 @@ export class MarkdownPipe implements PipeTransform {
|
|||||||
],
|
],
|
||||||
text: [
|
text: [
|
||||||
'transform', 'font-size'
|
'transform', 'font-size'
|
||||||
]
|
],
|
||||||
|
'mjx-assistive-mml': [
|
||||||
|
'unselectable', 'display', 'style',
|
||||||
|
],
|
||||||
|
math: [
|
||||||
|
'xmlns',
|
||||||
|
],
|
||||||
|
mrow: [
|
||||||
|
'data-mjx-texclass',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
parser: {
|
parser: {
|
||||||
lowerCaseAttributeNames: false,
|
lowerCaseAttributeNames: false,
|
||||||
|
Reference in New Issue
Block a user