You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing attributes with underscores using symbols, such as id: :my_id, they are converted to id="my-id" on the resulting HTML.
The expected behavior is that they retain the underscore, e.g. id="my_id".
Version
This is happening on 2.0.0.rc1.
Reproduction
script.rb
require'bundler/inline'gemfiledosource'https://rubygems.org'gem'phlex','2.0.0.rc1'gem'rspec'endclassHelloWorld < Phlex::HTMLdefview_template# When passed as strings, the values retain the underscores.h1id: "hello_world",class: "hello_world"doend# When passed as symbols, the values dasherized.h2id: :hello_world,class: :hello_worlddoendendendRSpec.describeHelloWorlddosubject{described_class.new}describe"#call"doit"retains underscores for attributes"dorendered=subject.callexpect(rendered).toeq(%(<h1 id="hello_world" class="hello_world"></h1><h2 id="hello_world" class="hello_world"></h2>))endendendRSpec.configuredo |config|
config.formatter=:documentationendRSpec::Core::Runner.run([])
Description
When passing attributes with underscores using symbols, such as
id: :my_id
, they are converted toid="my-id"
on the resulting HTML.The expected behavior is that they retain the underscore, e.g.
id="my_id"
.Version
This is happening on
2.0.0.rc1
.Reproduction
script.rb
Run via:
Output:
The text was updated successfully, but these errors were encountered: