diff --git a/CHANGELOG b/CHANGELOG
index 9ca7fda9f..a6db41741 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
+- Support MathML in HTML message preview (#5182)
- Rename Addressbook to Contacts (#5233)
- Remove PHP mail() support, smtp_server is required now (#5340)
- Display full message subject in onmouseover on truncated subject in mail view (#5346)
diff --git a/program/lib/Roundcube/rcube_washtml.php b/program/lib/Roundcube/rcube_washtml.php
index d03f04af4..e1058fd8d 100644
--- a/program/lib/Roundcube/rcube_washtml.php
+++ b/program/lib/Roundcube/rcube_washtml.php
@@ -76,7 +76,7 @@
* - base URL support
* - invalid HTML comments removal before parsing
* - "fixing" unitless CSS values for XHTML output
- * - base url resolving
+ * - SVG and MathML support
*/
/**
@@ -111,6 +111,15 @@ class rcube_washtml
'feflood', 'fefunca', 'fefuncb', 'fefuncg', 'fefuncr', 'fegaussianblur',
'feimage', 'femerge', 'femergenode', 'femorphology', 'feoffset',
'fespecularlighting', 'fetile', 'feturbulence',
+ // MathML
+ 'math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr',
+ 'mmuliscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow',
+ 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd',
+ 'mtext', 'mtr', 'munder', 'munderover', 'maligngroup', 'malignmark',
+ 'mprescripts', 'semantics', 'annotation', 'annotation-xml', 'none',
+ 'infinity', 'matrix', 'matrixrow', 'ci', 'cn', 'sep', 'apply',
+ 'plus', 'minus', 'eq', 'power', 'times', 'divide', 'csymbol', 'root',
+ 'bvar', 'lowlimit', 'uplimit',
);
/* Ignore these HTML tags and their content */
@@ -153,11 +162,24 @@ class rcube_washtml
'visibility', 'vert-adv-y', 'version', 'vert-origin-x', 'vert-origin-y', 'word-spacing',
'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2',
'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan',
+ // MathML
+ 'accent', 'accentunder', 'bevelled', 'close', 'columnalign', 'columnlines',
+ 'columnspan', 'denomalign', 'depth', 'display', 'displaystyle', 'encoding', 'fence',
+ 'frame', 'largeop', 'length', 'linethickness', 'lspace', 'lquote',
+ 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize',
+ 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign',
+ 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel',
+ 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator',
+ 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset',
+ 'fontsize', 'fontweight', 'fontstyle', 'fontfamily', 'groupalign', 'edge', 'side',
);
/* Elements which could be empty and be returned in short form (