mirror of
https://github.com/discourse/discourse.git
synced 2025-04-14 17:50:53 +08:00
FIX: Normalizer wasn't working with attributes without values
This commit is contained in:
parent
5a55ce65f3
commit
64cb8a3ce3
@ -74,9 +74,11 @@ class HtmlNormalize
|
||||
attrs.each do |a|
|
||||
buffer << " "
|
||||
buffer << a.name
|
||||
buffer << "='"
|
||||
buffer << a.value
|
||||
buffer << "'"
|
||||
if a.value
|
||||
buffer << "='"
|
||||
buffer << a.value
|
||||
buffer << "'"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -7,6 +7,10 @@ describe HtmlNormalize do
|
||||
HtmlNormalize.normalize(html)
|
||||
end
|
||||
|
||||
it "handles attributes without values" do
|
||||
expect(n "<img alt>").to eq("<img alt>")
|
||||
end
|
||||
|
||||
it "handles self closing tags" do
|
||||
|
||||
source = <<-HTML
|
||||
|
Loading…
x
Reference in New Issue
Block a user