Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 TYPO3 的掩码元素扩展来创建掩码元素。我正在使用 RTE 输入一些文本并将其打印到屏幕上。掩码元素的 HTML 如下所示:
<f:if condition="{data.tx_mask_text}">{data.tx_mask_text}<br /></f:if>
现在的问题是我可以在这里添加一些文本并且它也被打印出来了。但文本还包含 HTML 标记。因此,如果我在 RTE 中输入“Hello”作为文本,则输出为<p>Hello</p>.
<p>Hello</p>
知道如何解决这个问题吗?
我有一个类似的问题。您需要做的就是将一些 ViewHelper 添加到您的变量中,在您的情况下应该打印它:
<f:if condition="{data.tx_mask_text}">{data.tx_mask_text -> f:format.html(parseFuncTSPath: 'lib.parseFunc')}<br /></f:if>
ViewHelper 从文本中删除所有标签。在此处查看更多信息:
https://docs.typo3.org/other/typo3/view-helper-reference/9.5/en-us/typo3/fluid/latest/Format/Html.html