diff --git a/src/classes/IOClient.ts b/src/classes/IOClient.ts index 9002b4b..ae05a83 100644 --- a/src/classes/IOClient.ts +++ b/src/classes/IOClient.ts @@ -1007,6 +1007,18 @@ export class IOClient { * ``` */ markdown: this.createIOMethod('DISPLAY_MARKDOWN'), + /** + * Displays rendered HTML to the action user. + * + * **Usage:** + * + * ```typescript + * await io.display.html("Message body", { + * html: `
Hello, world!
` + * }); + * ``` + */ + html: this.createIOMethod('DISPLAY_HTML'), /** * Displays an image to the action user. * diff --git a/src/examples/basic/index.ts b/src/examples/basic/index.ts index 2e9bf7e..8e5da7f 100644 --- a/src/examples/basic/index.ts +++ b/src/examples/basic/index.ts @@ -573,6 +573,38 @@ const interval = new Interval({ return 'Pong!' }, }), + html: async () => { + await io.display.markdown('Done!') + + await io.display.html('HTML', { + html: '
Hello, world!
', + }) + + const richText = await io.input.richText('Text', {}) + + await io.display.html('What you entered', { + html: richText, + }) + + await io.display.html('Restricted', { + html: ` +Hello, in red!
++