Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const INDENT = ' ';
* The pattern to use when looking for explort commands to process
*/
const EXPORTPATTERN =
/(^export(?:\s+default)?(?:\s+abstract)?\s+(?:[^ {*}]+\s+(?:enum\s+)?[a-zA-Z0-9_.$]+|\{.* as .*\}))/m;
/(^export(?:\s+(?:default|abstract|async))?\s+(?:[^ {*}]+\s+(?:enum\s+)?[a-zA-Z0-9_.$]+|\{.* as .*\}))/m;

const EXPORT_IGNORE = ['type', 'interface'];
const EXPORT_PROCESS = ['let', 'const', 'var', 'function', 'class', 'namespace', 'enum', 'as'];
Expand Down
1 change: 1 addition & 0 deletions ts/a11y/explorer/Highlighter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,4 +482,5 @@ export function getHighlighter(
const highlighterMapping: { [key: string]: new () => Highlighter } = {
SVG: SvgHighlighter,
CHTML: ChtmlHighlighter,
generic: ChtmlHighlighter,
};
18 changes: 13 additions & 5 deletions ts/a11y/sre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import { Engine } from '#sre/common/engine.js';
import { parseInput } from '#sre/common/dom_util.js';
import { Variables } from '#sre/common/variables.js';
import { semanticMathmlSync } from '#sre/enrich_mathml/enrich.js';
export {
addPreference,
fromPreference,
toPreference,
import {
addPreference as addPref,
fromPreference as fromPref,
toPreference as toPref,
} from '#sre/speech_rules/clearspeak_preference_string.js';

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

// export const toEnriched = Api.toEnriched;
export const toEnriched = (mml: string) => {
return semanticMathmlSync(mml, Engine.getInstance().options);
};

export const parseDOM = parseInput;

//
// webpack doesn't seem to pick these up when building the ui/menu
// component when they are exported directly, so import first
// and then export.
//
export const addPreference = addPref;
export const fromPreference = fromPref;
export const toPreference = toPref;
9 changes: 7 additions & 2 deletions ts/handlers/html/HTMLDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { HTMLMathList } from './HTMLMathList.js';
import { HTMLDomStrings } from './HTMLDomStrings.js';
import { DOMAdaptor } from '../../core/DOMAdaptor.js';
import { InputJax } from '../../core/InputJax.js';
import { STATE, ProtoItem, Location } from '../../core/MathItem.js';
import { STATE, newState, ProtoItem, Location } from '../../core/MathItem.js';
import { StyleJson } from '../../util/StyleJson.js';

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

/**
* Add STATE value for adding the stylesheets (after INSERTED)
*/
newState('STYLES', STATE.INSERTED + 1);

/*****************************************************************/
/**
* The HTMLDocument class (extends AbstractMathDocument)
Expand All @@ -71,7 +76,7 @@ export class HTMLDocument<N, T, D> extends AbstractMathDocument<N, T, D> {
...AbstractMathDocument.OPTIONS,
renderActions: expandable({
...AbstractMathDocument.OPTIONS.renderActions,
styles: [STATE.INSERTED + 1, '', 'updateStyleSheet', false] // update styles on a rerender() call
styles: [STATE.STYLES, '', 'updateStyleSheet', false] // update styles on a rerender() call
}),
MathList: HTMLMathList, // Use the HTMLMathList for MathLists
MathItem: HTMLMathItem, // Use the HTMLMathItem for MathItem
Expand Down