From 5c0ead37bf73b678b08742826e19d7a8395ce01e Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Mon, 27 Mar 2023 15:14:02 -0400 Subject: [PATCH] docs(config): update innerHTML comments (#27032) --- core/src/components.d.ts | 24 +++++++++---------- core/src/components/alert/alert.tsx | 6 ++--- .../infinite-scroll-content.tsx | 6 ++--- core/src/components/loading/loading.tsx | 6 ++--- .../refresher-content/refresher-content.tsx | 14 +++++------ core/src/components/toast/toast.tsx | 6 ++--- core/src/utils/config.ts | 4 +++- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 532af08408..b0481584cb 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -272,7 +272,7 @@ export namespace Components { */ "leaveAnimation"?: AnimationBuilder; /** - * The main message to be displayed in the alert. `message` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * The main message to be displayed in the alert. `message` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "message"?: string | IonicSafeString; /** @@ -1135,7 +1135,7 @@ export namespace Components { */ "loadingSpinner"?: SpinnerTypes | null; /** - * Optional text to display while loading. `loadingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Optional text to display while loading. `loadingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "loadingText"?: string | IonicSafeString; } @@ -1554,7 +1554,7 @@ export namespace Components { */ "leaveAnimation"?: AnimationBuilder; /** - * Optional text content to display in the loading indicator. This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Optional text content to display in the loading indicator. This property accepts custom HTML as a string. Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "message"?: string | IonicSafeString; /** @@ -2382,7 +2382,7 @@ export namespace Components { */ "pullingIcon"?: SpinnerTypes | string | null; /** - * The text you want to display when you begin to pull down. `pullingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * The text you want to display when you begin to pull down. `pullingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "pullingText"?: string | IonicSafeString; /** @@ -2390,7 +2390,7 @@ export namespace Components { */ "refreshingSpinner"?: SpinnerTypes | null; /** - * The text you want to display when performing a refresh. `refreshingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * The text you want to display when performing a refresh. `refreshingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "refreshingText"?: string | IonicSafeString; } @@ -3118,7 +3118,7 @@ export namespace Components { */ "leaveAnimation"?: AnimationBuilder; /** - * Message to be shown in the toast. This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Message to be shown in the toast. This property accepts custom HTML as a string. Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "message"?: string | IonicSafeString; /** @@ -4235,7 +4235,7 @@ declare namespace LocalJSX { */ "leaveAnimation"?: AnimationBuilder; /** - * The main message to be displayed in the alert. `message` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * The main message to be displayed in the alert. `message` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "message"?: string | IonicSafeString; /** @@ -5169,7 +5169,7 @@ declare namespace LocalJSX { */ "loadingSpinner"?: SpinnerTypes | null; /** - * Optional text to display while loading. `loadingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Optional text to display while loading. `loadingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "loadingText"?: string | IonicSafeString; } @@ -5584,7 +5584,7 @@ declare namespace LocalJSX { */ "leaveAnimation"?: AnimationBuilder; /** - * Optional text content to display in the loading indicator. This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Optional text content to display in the loading indicator. This property accepts custom HTML as a string. Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "message"?: string | IonicSafeString; /** @@ -6421,7 +6421,7 @@ declare namespace LocalJSX { */ "pullingIcon"?: SpinnerTypes | string | null; /** - * The text you want to display when you begin to pull down. `pullingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * The text you want to display when you begin to pull down. `pullingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "pullingText"?: string | IonicSafeString; /** @@ -6429,7 +6429,7 @@ declare namespace LocalJSX { */ "refreshingSpinner"?: SpinnerTypes | null; /** - * The text you want to display when performing a refresh. `refreshingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * The text you want to display when performing a refresh. `refreshingText` can accept either plaintext or HTML as a string. To display characters normally reserved for HTML, they must be escaped. For example `` would become `<Ionic>` For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "refreshingText"?: string | IonicSafeString; } @@ -7214,7 +7214,7 @@ declare namespace LocalJSX { */ "leaveAnimation"?: AnimationBuilder; /** - * Message to be shown in the toast. This property accepts custom HTML as a string. Developers who only want to pass plain text can disable the custom HTML functionality by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Message to be shown in the toast. This property accepts custom HTML as a string. Content is parsed as plaintext by default. `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config before custom HTML can be used. */ "message"?: string | IonicSafeString; /** diff --git a/core/src/components/alert/alert.tsx b/core/src/components/alert/alert.tsx index 6330446dcb..1efcafbbb6 100644 --- a/core/src/components/alert/alert.tsx +++ b/core/src/components/alert/alert.tsx @@ -109,9 +109,9 @@ export class Alert implements ComponentInterface, OverlayInterface { * For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) * * This property accepts custom HTML as a string. - * Developers who only want to pass plain text - * can disable the custom HTML functionality - * by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Content is parsed as plaintext by default. + * `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config + * before custom HTML can be used. */ @Prop() message?: string | IonicSafeString; diff --git a/core/src/components/infinite-scroll-content/infinite-scroll-content.tsx b/core/src/components/infinite-scroll-content/infinite-scroll-content.tsx index 34e51aced5..747d6fab63 100644 --- a/core/src/components/infinite-scroll-content/infinite-scroll-content.tsx +++ b/core/src/components/infinite-scroll-content/infinite-scroll-content.tsx @@ -33,9 +33,9 @@ export class InfiniteScrollContent implements ComponentInterface { * For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) * * This property accepts custom HTML as a string. - * Developers who only want to pass plain text - * can disable the custom HTML functionality - * by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Content is parsed as plaintext by default. + * `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config + * before custom HTML can be used. */ @Prop() loadingText?: string | IonicSafeString; diff --git a/core/src/components/loading/loading.tsx b/core/src/components/loading/loading.tsx index cf8ab54584..13cb5c5c19 100644 --- a/core/src/components/loading/loading.tsx +++ b/core/src/components/loading/loading.tsx @@ -79,9 +79,9 @@ export class Loading implements ComponentInterface, OverlayInterface { * Optional text content to display in the loading indicator. * * This property accepts custom HTML as a string. - * Developers who only want to pass plain text - * can disable the custom HTML functionality - * by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Content is parsed as plaintext by default. + * `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config + * before custom HTML can be used. */ @Prop() message?: string | IonicSafeString; diff --git a/core/src/components/refresher-content/refresher-content.tsx b/core/src/components/refresher-content/refresher-content.tsx index 6bed4e27ab..0ade928a7c 100644 --- a/core/src/components/refresher-content/refresher-content.tsx +++ b/core/src/components/refresher-content/refresher-content.tsx @@ -35,10 +35,9 @@ export class RefresherContent implements ComponentInterface { * * For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) * - * This property accepts custom HTML as a string. - * Developers who only want to pass plain text - * can disable the custom HTML functionality - * by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Content is parsed as plaintext by default. + * `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config + * before custom HTML can be used. */ @Prop() pullingText?: string | IonicSafeString; @@ -56,10 +55,9 @@ export class RefresherContent implements ComponentInterface { * * For more information: [Security Documentation](https://ionicframework.com/docs/faq/security) * - * This property accepts custom HTML as a string. - * Developers who only want to pass plain text - * can disable the custom HTML functionality - * by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Content is parsed as plaintext by default. + * `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config + * before custom HTML can be used. */ @Prop() refreshingText?: string | IonicSafeString; diff --git a/core/src/components/toast/toast.tsx b/core/src/components/toast/toast.tsx index 0242d7bd38..64dc0060ea 100644 --- a/core/src/components/toast/toast.tsx +++ b/core/src/components/toast/toast.tsx @@ -114,9 +114,9 @@ export class Toast implements ComponentInterface, OverlayInterface { /** * Message to be shown in the toast. * This property accepts custom HTML as a string. - * Developers who only want to pass plain text - * can disable the custom HTML functionality - * by setting `innerHTMLTemplatesEnabled: false` in the Ionic config. + * Content is parsed as plaintext by default. + * `innerHTMLTemplatesEnabled` must be set to `true` in the Ionic config + * before custom HTML can be used. */ @Prop() message?: string | IonicSafeString; diff --git a/core/src/utils/config.ts b/core/src/utils/config.ts index a4de594271..4cf3cc08d0 100644 --- a/core/src/utils/config.ts +++ b/core/src/utils/config.ts @@ -193,7 +193,9 @@ export interface IonicConfig { * Relevant Components: ion-alert, ion-infinite-scroll-content, ion-loading, ion-refresher-content, ion-toast * If `false`, all `innerHTML` usage will be disabled in Ionic, and * custom HTML will not be usable in the relevant components. - * `innerHTML` usage is enabled by default. + * If `true`, all `innerHTML` usage will be enabled in Ionic, and + * custom HTML will be usable in the relevant components. + * `innerHTML` usage is disabled by default. */ innerHTMLTemplatesEnabled?: boolean;