Skip to content

Commit

Permalink
Merge pull request #285 from mathjax/a11y_explorer_corrections
Browse files Browse the repository at this point in the history
Corrects some explorer problems.
  • Loading branch information
zorkow authored Jun 12, 2019
2 parents 21f0e07 + 2e37dec commit d82cbac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion mathjax3-ts/a11y/complexity/collapse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,17 +382,26 @@ export class Collapse {
}
}

private idCount = 0;
/**
* @return {string} A unique id string.
*/
private makeId(): string {
return 'mjx-collapse-' + this.idCount++;
}

public makeAction(node: MmlNode) {
if (node.isKind('math')) {
node = this.addMrow(node);
}
const factory = this.complexity.factory;
const marker = node.getProperty('collapse-marker') as string;
const parent = node.parent;
var maction = factory.create('maction', {
let maction = factory.create('maction', {
actiontype: 'toggle',
selection: 2,
'data-collapsible': true,
id: this.makeId(),
'data-semantic-complexity': node.attributes.get('data-semantic-complexity')
}, [
factory.create('mtext', {mathcolor: 'blue'}, [
Expand Down
2 changes: 1 addition & 1 deletion mathjax3-ts/a11y/explorer/Explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export class SpeechExplorer extends AbstractKeyExplorer implements KeyExplorer {
const jax = this.document.outputJax.name;
this.highlighter = sre.HighlighterFactory.highlighter(
this.background, this.foreground,
{renderer: jax === 'CHTML' ? 'CommonHTML' : jax}
{renderer: jax}
);
// Add speech
this.speechGenerator = new sre.TreeSpeechGenerator();
Expand Down

0 comments on commit d82cbac

Please sign in to comment.