Created
April 11, 2018 22:59
-
-
Save hanneshapke/44e6f17341b71955114b7c2040be8622 to your computer and use it in GitHub Desktop.
Generate the text tag with the color attribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def cstr(s, color='black'): | |
return "<text style=\"color:{}\">{}</text>".format(color, s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.