Bug Report: Rich Text Editor Error with Apostrophe (')

Hi Retool Community,

I’ve encountered a bug with the Rich Text Editor component. Whenever I input an apostrophe (') within the text, it raises an error and the input is not inserted successfully. However, if I remove the apostrophe, the text is inserted without any issues.

Steps to reproduce the issue:

  1. Add a Rich Text Editor component to your app.
  2. Enter a text containing an apostrophe (e.g., "It's a bug").
  3. Attempt to insert the text.

Expected behavior: The text should be inserted successfully, including the apostrophe.

Actual behavior: An error is raised, and the text is not inserted.

Removing the apostrophe allows the text to be inserted without errors.

This issue is affecting our ability to use the Rich Text Editor for content that includes apostrophes. Any help or insights on resolving this would be greatly appreciated.

Thanks!

Hi @Islam_AlAfifi! Thanks for reaching out and reporting a potential bug. Looking at what you've shared, though, this looks more like an issue with the insert_mentors_notes query than the Rich Text Editor component itself.

I'd be happy to help figure out exactly what is going on here! Would you mind sharing the details of the query and connected resource? My guess is that you're working with a SQL resource here, which natively interprets the apostrophe as a special character for defining strings.

You should be able to get around this behavior by configuring your resource to use prepared statements. You can find the toggle for this setting inside your resource's "Advanced options" settings. You'll want to make sure this box is unchecked.

I hope that helps!