加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby – 在haml的末尾斜线 – 我应该清理它吗?

发布时间:2020-12-17 01:33:20 所属栏目:百科 来源:网络整理
导读:我想知道为什么在我的项目的源代码中,我有时会在行的末尾看到/( Haml). %meta{:content = "text/html; charset=utf-8","http-equiv" = "Content-Type"}/ 也许这是由于一些HTML到Haml的转换,但为什么呢? 我找不到任何关于那个的文档.只是想知道我是否应该清
我想知道为什么在我的项目的源代码中,我有时会在行的末尾看到/( Haml).

%meta{:content => "text/html; charset=utf-8","http-equiv" => "Content-Type"}/

也许这是由于一些HTML到Haml的转换,但为什么呢?

我找不到任何关于那个的文档.只是想知道我是否应该清理它.

解决方法

它创建了一个void自动关闭标记.

The forward slash character,when placed at the end of a tag
definition,causes Haml to treat it as being an empty (or void)
element. Depending on the format,the tag will be rendered either
without a closing tag (:html4 or :html5),or as a self-closing tag
(:xhtml).

请参阅HAML文档:http://haml.info/docs/yardoc/file.REFERENCE.html#empty-void-tags-

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读