ninest/aquaui

Escaping double quotes

Closed this issue · 1 comments

Single quotes work fine, but double quotes don't.

All double quotes are escaped:

script = script.replace('"', '\\"')

and this causes issues when there are double quotes in the string.

from aquaui import Alert, Buttons

# Works
Alert("How're you?").show()

# Doesn't work
Alert('How"re you?').show()
Alert('How\\"re you?').show()

Single quotes work fine.

from aquaui import Alert

Alert("This is a 'quote'").show()

For double-quotes, however, you have to escape them by inserting not one, but two backslashes. You also have to use single-quotes for the string:

Alert('This is a \\"quote\\"').show()

This may be changed and made simpler in the future.