When I add parathesis to the next line of the label, it prints in my HTML with a colon added:
question_3 = forms.MultipleChoiceField(choices=QUESTION_3_CHOICES,
widget=forms.CheckboxSelectMultiple(), label = mark_safe('Which of
these styles do you like? (choose multiple)'))
A shortcut in my form is output as follows in my HTML:
Which of these styles do you like? (choose multiple):
When I remove '(select multiple)', it prints correctly like this, without adding a colon:
Which of these styles do you like?
I tried converting all the text to unicode before using mark_safe by doing the following:
question_3 = forms.MultipleChoiceField(choices=QUESTION_3_CHOICES,
widget=forms.CheckboxSelectMultiple(), label = mark_safe('Which of
these styles do you like? (choose multiple)').decode('unicode-escape'))
But this cannot be fixed ...
source
share