ruby-on-rails HTML代码中没有出现随机的“S”

3j86kqsm  于 4个月前  发布在  Ruby
关注(0)|答案(1)|浏览(74)

这是我见过的最奇怪的问题,但是在我的代码中出现了一个随机的“s”。这是在Rails 7上,但是我真的不认为这是Rails/ERB问题。
下面是问题中的“s”:x1c 0d1x
下面是代码的呈现方式(通过检查源代码),其中没有S出现

<div class="search mt-3 mb-4">
    <input class="form-control" id="myInput" type="text" placeholder="Filter products list...">
  </div>

  <div id="searchable-products-list">
    <div id="products">
      <table class="table small">
        <thead>
          <tr>
            <th scope="col">Brand</th>
            <th scope="col">Product</th>
            <th scope="col">LGW SKU</th>
            <th scope="col">Model</th>
            <th scope="col">Color</th>
            <th scope="col">Voltage</th>
            <th scope="col">MSRP</th>
            <th scope="col">MAP</th>
            <th scope="col">Images</th>            
            <th scope="col">Actions</th>
          </tr>
        </thead>
        <tbody>

字符串
然而,这里有一个代码的屏幕截图,其中“s”清晰可见:



我在我的CSS/SCSS中做了一个command + f,整个事情中没有beforeafter语句。
有人能帮我弄清楚这东西是从哪来的吗?

6tdlim6h

6tdlim6h1#

如果您无意中在页面中包含了这样的内容:

<table>
  <tr>
    <td>foo</td>s
  </tr>
</table>

字符串
浏览器中的html解析器不知道如何处理虚假的“s”,所以它把它放在表格之前。仔细看看你正在生成的html,虚假的字母可能不在浏览器解析你的标记后告诉你的地方。

相关问题