gpt4 book ai didi

tinymce - 在 Handlebars 模板中使用 TinyMCE

转载 作者:行者123 更新时间:2023-12-01 15:01:35 27 4
gpt4 key购买 nike

我正在尝试使用 TinyMCE 来允许我的用户修改 Handlebars 报告模板。该模板包含几个对 TinyMCE 无效的元素,它们正在被移动。查看 {{#each data}} 和 {{/each}}

这是我的 Handlebars 模板的良好 HTML 代码:

<table class="table table-bordered">
<thead>
<tr>
<th><h4>Item</h4></th>
<th><h4 class="text-right">Quantity</h4></th>
<th><h4 class="text-right">Rate/Price</h4></th>
<th><h4 class="text-right">Sub Total</h4></th>
</tr>
</thead>
<tbody>
{{#each Details}}
<tr>
<td>{{Item}}<br><small>{{Description}}</small></td>
<td class="text-right">{{Quantity}}</td>
<td class="text-right">{{Rate}} {{UnitOfMeasure}}</td>
<td class="text-right">{{Amount}}</td>
</tr>
{{/each}}
</tbody>
</table>

在我将代码传递到 TinyMCE 后,结果如下:
{{#each Details}}{{/each}}
<table class="table table-bordered">
<thead>
<tr><th>
<h4>Item</h4>
</th><th>
<h4 class="text-right">Quantity</h4>
</th><th>
<h4 class="text-right">Rate/Price</h4>
</th><th>
<h4 class="text-right">Sub Total</h4>
</th></tr>
</thead>
<tbody>
<tr>
<td>{{Item}}<br /><small>{{Description}}</small></td>
<td class="text-right">{{Quantity}}</td>
<td class="text-right">{{Rate}} {{UnitOfMeasure}}</td>
<td class="text-right">{{Amount}}</td>
</tr>
</tbody>
</table>

有没有人遇到过插件或其他可能对我有帮助的东西?

最佳答案

我刚刚遇到了这个问题...我有一封订单确认电子邮件,我需要使用表格中的订单项目列表对其进行配置;同样的问题。
我刚刚意识到我可能不应该使用表格,因为它们没有响应,但我最终能够用 HTML 注释解决问题,如下所示:

<tr style="font-weight: bold;">
<td style="width: 145px;">Qty</td>
<td>Item</td>
<td>Unit Price</td>
<td>Total</td>
</tr>
<!--{{#order.line_items}} -->
<tr repeat="">
<td style="width: 145px;">{{quantity}}</td>
<td>{{product.name}}</td>
<td>{{currency unit_price}}</td>
<td>{{currency total}}</td>
</tr>
<!--{{/order.line_items}} -->
<tr>
<td style="width: 145px;">&nbsp;</td>
<td>&nbsp;</td>
<td><strong>Subtotal:</strong></td>
<td>{{currency order.subtotal}}</td>
</tr>

关于tinymce - 在 Handlebars 模板中使用 TinyMCE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28554437/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com