@brightspace-ui/core 3.160.1 → 3.160.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/helpers/mathjax.js +13 -2
  2. package/package.json +1 -1
@@ -1,3 +1,5 @@
1
+ import { getFlag } from './flags.js';
2
+
1
3
  /* When updating MathJax, update mathjaxBaseUrl to use the new version
2
4
  * and verify that the font mappings included in mathjaxFontMappings
3
5
  * match what's present in the MathJax-src repo.
@@ -38,8 +40,17 @@ class HtmlBlockMathRenderer {
38
40
 
39
41
  async render(elem, options) {
40
42
  if (!options.contextValues) return elem;
41
- const context = options.contextValues.get(mathjaxContextKey);
42
- if (context === undefined) return elem;
43
+ let context = options.contextValues.get(mathjaxContextKey);
44
+
45
+ // For 20.25.11, update to default to true if flag helper can't be found
46
+ if (getFlag('shield-12649-mathjax-default-context', false)) {
47
+ context = context || {
48
+ renderLatex: false,
49
+ outputScale: 1
50
+ };
51
+ } else {
52
+ if (context === undefined) return elem;
53
+ }
43
54
 
44
55
  if (!elem.querySelector('math') && !(context.renderLatex && /\$\$|\\\(|\\\[|\\begin{|\\ref{|\\eqref{/.test(elem.innerHTML))) return elem;
45
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.160.1",
3
+ "version": "3.160.2",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",