-
Notifications
You must be signed in to change notification settings - Fork 14
Don't escape HTML chars inside Django tags inside attribute values #66
Conversation
hamlpy/parser/utils.py
Outdated
""" | ||
Escapes HTML entities, matching substitutions used the Ruby Haml library | ||
Escapes HTML entities, matching substitutions used the Ruby Haml library. Entities that occur inside Django tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"used by"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about something like {{ foo|escape:"&" }}
?
hamlpy/parser/utils.py
Outdated
""" | ||
Escapes HTML entities, matching substitutions used the Ruby Haml library | ||
Escapes HTML entities, matching substitutions used the Ruby Haml library. Entities that occur inside Django tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about something like {{ foo|escape:"&" }}
?
@nicpottier updated to also ignore entities inside {{ .. }} and fixed the typo |
hamlpy/parser/utils.py
Outdated
s = s.replace("'", "'") | ||
return s | ||
new_text = [] | ||
state = 0 # 0 = normal, 1 = in tag, 2 = in expression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably be enum ya?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well I guess so, if we're trying to write "good code"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if only there was a pep for that
No description provided.