Skip to content

Commit 0204242

Browse files
authored
Merge pull request #1276 from mathjax/fix/build
Update build and ui/menu so its builds with new highligher
2 parents 351698e + 07eae1a commit 0204242

4 files changed

Lines changed: 22 additions & 8 deletions

File tree

components/bin/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const INDENT = ' ';
3636
* The pattern to use when looking for explort commands to process
3737
*/
3838
const EXPORTPATTERN =
39-
/(^export(?:\s+default)?(?:\s+abstract)?\s+(?:[^ {*}]+\s+(?:enum\s+)?[a-zA-Z0-9_.$]+|\{.* as .*\}))/m;
39+
/(^export(?:\s+(?:default|abstract|async))?\s+(?:[^ {*}]+\s+(?:enum\s+)?[a-zA-Z0-9_.$]+|\{.* as .*\}))/m;
4040

4141
const EXPORT_IGNORE = ['type', 'interface'];
4242
const EXPORT_PROCESS = ['let', 'const', 'var', 'function', 'class', 'namespace', 'enum', 'as'];

ts/a11y/explorer/Highlighter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,4 +482,5 @@ export function getHighlighter(
482482
const highlighterMapping: { [key: string]: new () => Highlighter } = {
483483
SVG: SvgHighlighter,
484484
CHTML: ChtmlHighlighter,
485+
generic: ChtmlHighlighter,
485486
};

ts/a11y/sre.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ import { Engine } from '#sre/common/engine.js';
2626
import { parseInput } from '#sre/common/dom_util.js';
2727
import { Variables } from '#sre/common/variables.js';
2828
import { semanticMathmlSync } from '#sre/enrich_mathml/enrich.js';
29-
export {
30-
addPreference,
31-
fromPreference,
32-
toPreference,
29+
import {
30+
addPreference as addPref,
31+
fromPreference as fromPref,
32+
toPreference as toPref,
3333
} from '#sre/speech_rules/clearspeak_preference_string.js';
3434

3535
export const locales = Variables.LOCALES;
@@ -42,9 +42,17 @@ export const engineSetup = () => {
4242
return Engine.getInstance().json();
4343
};
4444

45-
// export const toEnriched = Api.toEnriched;
4645
export const toEnriched = (mml: string) => {
4746
return semanticMathmlSync(mml, Engine.getInstance().options);
4847
};
4948

5049
export const parseDOM = parseInput;
50+
51+
//
52+
// webpack doesn't seem to pick these up when building the ui/menu
53+
// component when they are exported directly, so import first
54+
// and then export.
55+
//
56+
export const addPreference = addPref;
57+
export const fromPreference = fromPref;
58+
export const toPreference = toPref;

ts/handlers/html/HTMLDocument.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { HTMLMathList } from './HTMLMathList.js';
3333
import { HTMLDomStrings } from './HTMLDomStrings.js';
3434
import { DOMAdaptor } from '../../core/DOMAdaptor.js';
3535
import { InputJax } from '../../core/InputJax.js';
36-
import { STATE, ProtoItem, Location } from '../../core/MathItem.js';
36+
import { STATE, newState, ProtoItem, Location } from '../../core/MathItem.js';
3737
import { StyleJson } from '../../util/StyleJson.js';
3838

3939
/*****************************************************************/
@@ -49,6 +49,11 @@ import { StyleJson } from '../../util/StyleJson.js';
4949
*/
5050
export type HTMLNodeArray<N, T> = [N | T, number][][];
5151

52+
/**
53+
* Add STATE value for adding the stylesheets (after INSERTED)
54+
*/
55+
newState('STYLES', STATE.INSERTED + 1);
56+
5257
/*****************************************************************/
5358
/**
5459
* The HTMLDocument class (extends AbstractMathDocument)
@@ -71,7 +76,7 @@ export class HTMLDocument<N, T, D> extends AbstractMathDocument<N, T, D> {
7176
...AbstractMathDocument.OPTIONS,
7277
renderActions: expandable({
7378
...AbstractMathDocument.OPTIONS.renderActions,
74-
styles: [STATE.INSERTED + 1, '', 'updateStyleSheet', false] // update styles on a rerender() call
79+
styles: [STATE.STYLES, '', 'updateStyleSheet', false] // update styles on a rerender() call
7580
}),
7681
MathList: HTMLMathList, // Use the HTMLMathList for MathLists
7782
MathItem: HTMLMathItem, // Use the HTMLMathItem for MathItem

0 commit comments

Comments
 (0)