以下のコンテンツをデフォルトとして ckeditor を開いています。
<textarea id="editor1" name="editor1" rows="30" cols="120"><p>We can use <strong>prettify </strong>to auto-format the Computer programming code at web page.</p>
<p><strong>How to use?</strong></p>
<p>Just add below line;</p>
<p><code class="prettyprint"><span style="line-height: 1.6em;"><script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script></span></code</p>
<p><span style="line-height: 1.6em;">Then, put the code line in below tab;</span></p>
<p><code class="prettyprint"><code class="prettyprint">...</code></code></p>
<p><span style="color: rgb(0, 0, 0); font-family: monospace; font-size: medium; line-height: normal;">or,</span></p>
<p>Download the complete code files from <a href="https://code.google.com/p/google-code-prettify/">https://code.google.com/p/google-code-prettify/</a>(even can learn more about prettify) to your server and change above script tag line like below;</p>
<p><code class="prettyprint"><script src="path/to/directory/run_prettify.js"></script></code><br /> </p>
</textarea>
<script>CKEDITOR.replace( "editor1");</script>
ただし、出力の HTML タグ コードが欠落しています。出力は以下 (下線) です。
prettify を使用して、Web ページのコンピューター プログラミング コードを自動フォーマットできます。
使い方?
以下の行を追加するだけです。
次に、コード行を下のタブに配置します。
...
また、
完全なコード ファイルをhttps://code.google.com/p/google-code-prettify/からサーバーにダウンロードし (prettify の詳細も参照できます)、上記のスクリプト タグ行を次のように変更します。
期待される出力:
助けてください。