Skip to content

Commit c21b459

Browse files
crisbetoAndrewKushnir
authored andcommitted
fix(compiler): add math elements to schema (#55631) (#55645)
Fixes that we didn't have the MathML elements in the schema. Note that we can't discover which tag names are available by looking at globally-available classes, because all MathML elements are `MathMLElement` rather than something like `SVGCircleElement`. As such, I ended up having to hardcode the currently-available tags. Fixes #55608. PR Close #55631 PR Close #55645
1 parent ec5807c commit c21b459

File tree

3 files changed

+243
-158
lines changed

3 files changed

+243
-158
lines changed

packages/compiler-cli/test/ngtsc/template_typecheck_spec.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3101,6 +3101,32 @@ export declare class AnimationEvent {
31013101
1. If 'foo' is an Angular component, then verify that it is part of this module.
31023102
2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component.`);
31033103
});
3104+
3105+
it('should allow math elements', () => {
3106+
env.write(
3107+
'test.ts',
3108+
`
3109+
import {Component} from '@angular/core';
3110+
@Component({
3111+
template: \`
3112+
<math>
3113+
<mfrac>
3114+
<mn>1</mn>
3115+
<msqrt>
3116+
<mn>2</mn>
3117+
</msqrt>
3118+
</mfrac>
3119+
</math>
3120+
\`,
3121+
standalone: true,
3122+
})
3123+
export class MathCmp {}
3124+
`,
3125+
);
3126+
3127+
const diags = env.driveDiagnostics();
3128+
expect(diags.length).toBe(0);
3129+
});
31043130
});
31053131

31063132
// Test both sync and async compilations, see https://github.com/angular/angular/issues/32538

0 commit comments

Comments
 (0)