-
-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
Description
Even while it's encouraged to use Kebab-case for HTML-tags there are some use-cases where we have case-sensitive HTML elements, like in SVG (see #139). This would also allow to cleanup the special-handling we have for handling SVG elements in:
| subchild.name = SVG_ELEMENTS[subchild.name] if SVG_ELEMENTS.key?(subchild.name) |
Since we are using Nokogiri::HTML4::DocumentFragment for parsing the source it automatically casts all tag names to lowercase. While Nokogiri::HTML5::DocumentFragment would support case-sensitive tags, it doesn't support other things like properly detecting boolean attributes (see #119 and #120).
ERB Input:
<customElement>
<anotherElement/>
</customElement>Output:
class CustomelementComponent < Phlex::HTML
register_element :anotherelement
register_element :customelement
def template
customelement { anotherelement }
end
endExpected output:
class CustomelementComponent < Phlex::HTML
register_element :anotherElement
register_element :customElement
def template
customElement { anotherElement }
end
end