Commits

Andrea Barbasso authored and github-actions[bot] committed 3c665a736d8
[DURACOM-273] fix markdown rendering applying before mathjax rendering

(cherry picked from commit 66e1a2488b14c84b41486fabc77350f17d722b0d)
No tags

src/app/core/shared/client-math.service.ts

Modified
24 24 })
25 25 /**
26 26 * Provide the MathService for CSR
27 27 */
28 28 export class ClientMathService extends MathService {
29 29
30 30 protected isReady$: Subject<boolean>;
31 31
32 32 protected mathJaxOptions = {
33 33 tex: {
34 - inlineMath: [['$', '$'], ['\\(', '\\)']],
34 + inlineMath: [['$', '$'], ['$$', '$$'], ['\\(', '\\)']],
35 35 },
36 36 svg: {
37 37 fontCache: 'global',
38 38 },
39 39 startup: {
40 40 typeset: false,
41 41 },
42 42 };
43 43
44 44 protected mathJax: MathJaxConfig = {
101 101 return this.isReady$;
102 102 }
103 103
104 104 /**
105 105 * Render the specified element using the MathJax JavaScript
106 106 *
107 107 * @param element The element to render with MathJax
108 108 */
109 109 render(element: HTMLElement) {
110 110 if (environment.markdown.mathjax) {
111 - this._window.nativeWindow.MathJax.typesetPromise([element]);
111 + return (window as any).MathJax.typesetPromise([element]) as Promise<any>;
112 112 }
113 113 }
114 114 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut