我正在使用Ember实现Google结构化数据,并添加一些动态值
<script type="application/ld+json">
[{
"@context": "{{my-ember-hbs}}",
...呈现的html为:
<script type="application/ld+json">
[{
"@context": " // ember adds new line before and after
rendered-value-string
",
...发布于 2019-09-06 01:56:55
根据Handlebars docs,您可以使用代字号~来消除空格。
<script type="application/ld+json">
[{
"@context": "{{~my-ember-hbs~}}",
...{{my-ember-hbs}}内部也可能有空白,您需要考虑这些空白。
https://stackoverflow.com/questions/57803509
复制相似问题