本文介绍了嵌入php js html代码在tinymce,posible?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找很多,但没有找到 anithing ...

I have been looking a lot for it but haven't found anithing...

(我想要一些编辑器(我自己的CMS)

(i want just some editor -i know the same it's hard to get done- like the one i'm using now, where i can share my code in my blog)(My own CMS)

因此,我们可以使用一个新的代码,

So,

我想有些人通过这一个,可以使用tinyMce 嵌入代码?

I guess some went through this one before, can i embed code using tinyMce?

任何结论?

感谢很多

PD:我看到stackoverflow使用 WMD 不在线,但在github中,任何人都有使用示例(只有.js文件)

PD: i've seen that stackoverflow uses a fork from WMD wich is not online but in github, anyone has an example of use? (only .js files there)

PD2:再次感谢!

,一些回复得到prettyprint - >

Well, after some replies got to prettyprint -> here

只需要加载到$(document).ready()并且会prettify(lol)任何这些:

wich only need to be loaded on $(document).ready() And will prettify (lol) any of those:

<pre class="prettyprint"> code here  </pre>

所以我试图将这种格式添加到tinimce:

So i'm trying to add this format to tinimce with:

style_formats : [
                {title : 'Bold text', inline : 'b'},
                {title : 'Blue text', inline : 'span', styles : {color : '#006'}},
                {title : 'Blue header', block : 'h1', styles : {color : '#006'}},
          -->   {title : 'Codigo fuente', inline : 'pre', classes : 'prettyprint'},
                {title : 'Example 2', inline : 'span', classes : 'example2'},
                {title : 'Table styles'},
                {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
        ],

但是如果我使用它在$ _POST上变成< p>

But if i use it turns into a <p> on $_POST, why?

这个工作原理: {title:'Codigo fuente' block:'pre',classes:'prettyprint'},

这是我得到的问题

<pre ..>line 1</pre>
<pre ..>line 2</pre>

..

应用:

<pre..>
line1
line2
</pre>

我如何解决这个问题?如果我通过 inline 更改阻止,只是简单的风格甚至不适用:?

how can i solve this? if i change block by inline, simply the style it's not even applied :?

Gracias!

推荐答案

也许你可以使用这个:或其他一些语法荧光笔...

Maybe, you can use this one: SyntaxHighlighter or some other syntax highlighter...

并使用tinymce的论坛/网站,因为你的问题是关于tinymce。阅读手册。寻找插件和它们的实现。

And use the forum/website of tinymce, because your question is related to tinymce. Read the manual. Look for plugins and the implementation of them.

提示:首先在开发人员的资源中搜索或使用google ...

Hint: Search first in the Resources of the developers or use google...Google Results

这篇关于嵌入php js html代码在tinymce,posible?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 22:52