【问题标题】:Unable to render HAML in Codepen can't find error无法在 Codepen 中呈现 HAML 找不到错误
【发布时间】:2019-03-17 00:05:42
【问题描述】:

我正在从事 FreeCodeCamp 调查表项目。 我遇到了一个似乎与缩进有关的问题我不确定这是对 codepen 的限制,还是只是我自己的无知和糟糕的代码。

问题开始于:

%div.field
  %label.label
  %ul.options
  - @item = ['Single Player', 'Multiplayer', 'Local Coop', 'MMO', 'MOBA', 'Casual', 'Other']
  - item.each_with_index do |item, i|
     %li.option
        %input.option-input{name: 'option', type: 'radio', value: i, id: "option-#{i}"}/
        %label.option-label{:for => "option-#{i}"}= item

Pen

【问题讨论】:

  • 最后得到一个实际错误:“CodePen 从您的 Haml 中删除了以下单词,因为它们可能被用来做坏事。请删除它们并重试。->system”仍然不知道为什么.

标签: ruby haml


【解决方案1】:

CodePen 在 Twitter 上表示,出于安全原因,他们会从预处理代码中删除某些关键字。 2 年前,他们说他们计划让这个错误更友好。

https://twitter.com/kosai106/status/762348280156151809

【讨论】:

    猜你喜欢
    • 2012-05-05
    • 1970-01-01
    • 1970-01-01
    • 2013-09-05
    • 2021-09-02
    • 2011-11-30
    • 1970-01-01
    • 1970-01-01
    • 2020-07-05
    相关资源
    最近更新 更多