Preserve attribute ordering in Haml

蹲街弑〆低调 提交于 2019-12-20 02:22:40

问题


If I create an XML element in HAML:

%tag{:b => "b", :a => "a"}

I get this output:

<tag a="a" b="b"/>

Is it possible to keep the ordering of the attributes in HAML?

I need this for a client-side code to display values in certain order and don't want to pass extra information on the client just to maintain ordering.


回答1:


It's not possible with HAML because it's a hash.



来源:https://stackoverflow.com/questions/7766240/preserve-attribute-ordering-in-haml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!