Signed-off-by: Jean Privat <jean@pryen.org>
if attrs.has_key("class") or not classes.is_empty then
res.add " class=\""
for cls in classes do
if attrs.has_key("class") or not classes.is_empty then
res.add " class=\""
for cls in classes do
+ res.add cls.html_escape
res.add " "
end
if attrs.has_key("class") then
res.add " "
end
if attrs.has_key("class") then
+ res.add attrs["class"].html_escape
res.add " "
end
if res.last == " " then res.pop
res.add " "
end
if res.last == " " then res.pop
if attrs.has_key("style") or not css_props.is_empty then
res.add " style=\""
for k, v in attrs do
if attrs.has_key("style") or not css_props.is_empty then
res.add " style=\""
for k, v in attrs do
res.add "; "
end
if attrs.has_key("style") then
res.add "; "
end
if attrs.has_key("style") then
- res.add(attrs["style"])
+ res.add(attrs["style"].html_escape)
end
if res.last == "; " then res.pop
res.add "\""
end
if res.last == "; " then res.pop
res.add "\""
for key, value in attrs do
if key == "class" or key == "style" then continue
res.add " "
for key, value in attrs do
if key == "class" or key == "style" then continue
res.add " "
+ res.add key.html_escape
+ res.add value.html_escape