mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 15:51:16 +08:00
fix(many): innerHTML is disabled by default (#27029)
BREAKING CHANGE: The `innerHTMLTemplatesEnabled` Ionic Config now defaults to `false`. Developers can set this option to `true` if they would like to continue to use custom HTML features in `ion-alert`, `ion-infinite-scroll-content`, `ion-loading`, `ion-refresher-content`, and `ion-toast`.
This commit is contained in:
@ -100,6 +100,12 @@
|
||||
</ion-content>
|
||||
</ion-app>
|
||||
<script>
|
||||
window.Ionic = {
|
||||
config: {
|
||||
innerHTMLTemplatesEnabled: true,
|
||||
},
|
||||
};
|
||||
|
||||
async function openLoading(opts) {
|
||||
const loading = await loadingController.create(opts);
|
||||
await loading.present();
|
||||
|
||||
@ -3,7 +3,7 @@ import { Loading } from '../loading';
|
||||
import { config } from '../../../global/config';
|
||||
|
||||
describe('alert: custom html', () => {
|
||||
it('should allow for custom html by default', async () => {
|
||||
it('should not allow for custom html by default', async () => {
|
||||
const page = await newSpecPage({
|
||||
components: [Loading],
|
||||
html: `<ion-loading message="<button class='custom-html'>Custom Text</button>"></ion-loading>`,
|
||||
@ -11,7 +11,7 @@ describe('alert: custom html', () => {
|
||||
|
||||
const content = page.body.querySelector('.loading-content');
|
||||
expect(content.textContent).toContain('Custom Text');
|
||||
expect(content.querySelector('button.custom-html')).not.toBe(null);
|
||||
expect(content.querySelector('button.custom-html')).toBe(null);
|
||||
});
|
||||
|
||||
it('should allow for custom html', async () => {
|
||||
|
||||
Reference in New Issue
Block a user