Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Generate the text tag with the color attribute
def cstr(s, color='black'):
return "<text style=\"color:{}\">{}</text>".format(color, s)

This comment has been minimized.

Copy link

tiagoarasilva commented Mar 5, 2019

That's very nice and clean way but I would advise you just to beach the s as you can easily have an XSS attack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.