Html 为什么要用“为什么”这个词;Com&;害羞的";是否按Chrome渲染?没有软连字符
我有一个html代码片段:Html 为什么要用“为什么”这个词;Com&;害羞的";是否按Chrome渲染?没有软连字符,html,google-chrome,slim,hyphen,soft-hyphen,Html,Google Chrome,Slim,Hyphen,Soft Hyphen,我有一个html代码片段: <label class="col-xs-2 col-lg-2 control-label" for="param_comment">Com­ment</label> 在Chrome v.29中 我期望: Comment 软连字符有什么问题 更新: 我的意思是: <label class="col-xs-2 col-lg-2 control-label" for="param_comment">Com&s
<label class="col-xs-2 col-lg-2 control-label" for="param_comment">Com­ment</label>
在Chrome v.29中
我期望:
Comment
软连字符有什么问题
更新:
我的意思是:
<label class="col-xs-2 col-lg-2 control-label" for="param_comment">Com­ment</label>
现改为:
= label_tag(:"param_comment", "Com­ment".html_safe, class: "control-label")
因此,.html\u safe
有帮助
但是没有ruby代码也可以这样做吗?发布的HTML片段包含
Com&;害羞的这是一个新概念,因此它可以按定义工作。使用Com­;改为使用字符
(或者将软连字符作为字符输入,U+00AD:Com
)。因为它是一种特殊的软连字符,不是吗?我想有一个词“评论”分裂时,div是收缩太多,这是一个Unicode
问题??!对不起,我打错了-当然我有­代码>仍然打印Com­;我认为这是一个很小的错误:我有:=label\u标签(:“param\u comment”,“Com­;ment”,class:“control label”)
现在改为:=label\u标签(:“param\u comment”,“Com­;ment”。html\u-safe,class:“control label”)
。所以.html\u safe
有帮助。在没有ruby代码的情况下也可以这样做吗?那么页面上还有其他东西在咀嚼内容。首先检查浏览器收到的HTML文档(查看源代码)。
= label_tag(:"param_comment", "Com­ment", class: "control-label")
= label_tag(:"param_comment", "Com­ment".html_safe, class: "control-label")