为什么不格式化的PrimeFaces文本编辑器代码

发布于 2025-01-24 20:49:54 字数 836 浏览 1 评论 0 原文

我使用 primefaces 文本编辑器允许在使用 jsf 开发的论坛应用程序中创建内容。如果用户在 nore noreferrer“> text Editor < h:outputText值=“#{post.content}” evase =“ false”/> ,包含代码的部分显示为纯文本而不是代码, 。

primefaces未格式化的primefaces text Editor代码

从文本编辑器中生成的代码是:

<pre class="ql-syntax" spellcheck="false"><video>
     <source src="video1.mp4" type='video/mp4;  />
<video>
</pre>

调查后,似乎未应用文本编辑器中代码部分的“ QL-Syntax ”。

如何将文本编辑器中引入的代码部分显示为格式化代码?

感谢您的帮助。

I use Primefaces Text editor to allow the creation of content in a Forum application developed with JSF. If the user introduces code in the Text editor, it is displayed correctly in the Text editor but when displaying the content with <h:outputText value="#{post.content}" escape="false"/>, the part that contains the code is displayed as plain text and not as code.

Primefaces Text editor code not formatted

The code generated from Text editor is:

<pre class="ql-syntax" spellcheck="false"><video>
     <source src="video1.mp4" type='video/mp4;  />
<video>
</pre>

After investigation, it appears that the "ql-syntax" style of the code part in Text Editor is not applied.

How can i display the code part introduced in the Text editor as being formatted code ?

Thanks for help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情绪失控 2025-01-31 20:49:54

我找到了面临同样问题的人的解决方案。
有必要将 outputText 放在以下格式的div中,以便能够在

<div class="ql-container ql-snow">                                                    
   <div class="ql-editor">
        <h:outputText value="#{post.content}"  escape="false"/>                                                          
   </div>                                                    
</div>

I found the solution for those facing the same problem.
It is necessary to put the outputText in divs of the following format to be able to apply the style of Text editor outside Text editor itself .

<div class="ql-container ql-snow">                                                    
   <div class="ql-editor">
        <h:outputText value="#{post.content}"  escape="false"/>                                                          
   </div>                                                    
</div>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文