<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHPプログラマのバリ・ポジ情報ブログ &#187; fckeditor</title>
	<atom:link href="http://blog.veryposi.info/tag/fckeditor/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.veryposi.info</link>
	<description>PHP,JavaScriptやサーバーの設定などのプログラミングに関する情報をバリ・ポジティブに発信しているプログラマのブログ、『バリ・ポジ』</description>
	<lastBuildDate>Thu, 10 May 2012 06:23:01 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>FCKEditorでpreタグの改行が消えてしまう原因</title>
		<link>http://blog.veryposi.info/programing/cms/wordpress/wordpress-fckeditor-pre/</link>
		<comments>http://blog.veryposi.info/programing/cms/wordpress/wordpress-fckeditor-pre/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 04:52:32 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[fckeditor]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=420</guid>
		<description><![CDATA[FCKEditorを使用していてpreタグの中の改行コードが消えてしまう事象が発生 これは、ある特定の場合に発生していることが判明しました IE以外のブラウザを使用している。 （FireFoxなど） preタグの中でsp [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.fckeditor.net/">FCKEditor</a>を使用していてpreタグの中の改行コードが消えてしまう事象が発生<img alt="" src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/sign03.gif" /></p>
<p>これは、ある特定の場合に発生していることが判明しました<img alt="" src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/happy01.gif" /></p>
<ol>
<li>IE以外のブラウザを使用している。<br />
    （FireFoxなど）</li>
<li>preタグの中でspanタグを使用していて、そのspanタグの中で改行コードが使用されている<br />
    （ソースコードの整形の為のシンタックスハイライトを行っている場合に良く発生します）</li>
</ol>
<p>この条件がそろうとFCKEditorで「ソースモード」と「WYSIWYGモード」を切り替えているとpreタグの中のspanタグの中にあった改行コードがなくなってしまいます<img src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/weep.gif" alt="" /></p>
<p><a href="http://blog.veryposi.info/wp-content/uploads/2009/02/fckeditor-pre.gif" rel="lightbox[420]"><img height="100" width="300" src="http://blog.veryposi.info/wp-content/uploads/2009/02/fckeditor-pre-300x100.gif" alt="FCKEditorで改行コードが消える" title="FCKEditorで改行コードが消える" class="aligncenter size-medium wp-image-423" /></a></p>
<p>原因を調査した結果以下のことが判明しました。</p>
<ol>
<li>FCKEditorでは、preタグ直下の要素の改行はそのまま改行と判断し、残します。</li>
<li>preタグ以外のタグの中でbrでないただの改行コードがあった場合、半角スペースに置き換えます。</li>
</ol>
<p>となるとpreタグの中に別のタグがあった場合、別のタグの要素として判断され改行コードを半角スペースに置き換えてしまいます。</p>
<p>ということは、preタグの中のspanタグの中の改行コードは、半角スペースに変更されてしまうということです。（spanタグの中の改行コードと判断される為）</p>
<p>なのでこれを対策する為にFCKEditorのコアファイルに修正を加えました。</p>
<p>修正内容）</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre>
</td>
<td class="code">
<pre class="php">
*** original/fckxhtml.js	<span style="color: rgb(204, 102, 204);">2008</span><span style="color: rgb(204, 102, 204);">-10</span><span style="color: rgb(204, 102, 204);">-07</span> <span style="color: rgb(204, 102, 204);">13</span>:<span style="color: rgb(204, 102, 204);">52</span>:<span style="color: rgb(204, 102, 204);">24.000000000</span> <span style="color: rgb(204, 102, 204);">+0900</span>
--- fckxhtml.js	<span style="color: rgb(204, 102, 204);">2009</span><span style="color: rgb(204, 102, 204);">-02</span><span style="color: rgb(204, 102, 204);">-12</span> <span style="color: rgb(204, 102, 204);">09</span>:<span style="color: rgb(204, 102, 204);">47</span>:<span style="color: rgb(204, 102, 204);">39.000000000</span> <span style="color: rgb(204, 102, 204);">+0900</span>
***************
*** <span style="color: rgb(204, 102, 204);">189</span>,<span style="color: rgb(204, 102, 204);">195</span> ****
  			<span style="color: rgb(128, 128, 128); font-style: italic;">// This is a workaround for the Gecko bug here: https://bugzilla.mozilla.org/show_bug.cgi?id=92921</span>
  			<span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span> FCKBrowserInfo.IsGecko
  					&amp;&amp; htmlNode.tagName.toLowerCase<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span> == <span style="color: rgb(255, 0, 0);">'br'</span>
! 					&amp;&amp; htmlNode.parentNode.tagName.toLowerCase<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span> == <span style="color: rgb(255, 0, 0);">'pre'</span> <span style="color: rgb(102, 204, 102);">)</span>
  			<span style="color: rgb(102, 204, 102);">{</span>
  				<span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> val = <span style="color: rgb(255, 0, 0);">'<span style="color: rgb(0, 0, 153); font-weight: bold;">\r</span>'</span> ;
  				<span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span> htmlNode == htmlNode.parentNode.firstChild <span style="color: rgb(102, 204, 102);">)</span>
--- <span style="color: rgb(204, 102, 204);">189</span>,<span style="color: rgb(204, 102, 204);">199</span> ----
  			<span style="color: rgb(128, 128, 128); font-style: italic;">// This is a workaround for the Gecko bug here: https://bugzilla.mozilla.org/show_bug.cgi?id=92921</span>
  			<span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span> FCKBrowserInfo.IsGecko
  					&amp;&amp; htmlNode.tagName.toLowerCase<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span> == <span style="color: rgb(255, 0, 0);">'br'</span>
! 					&amp;&amp; <span style="color: rgb(102, 204, 102);">(</span>
! 						htmlNode.parentNode.tagName.toLowerCase<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(102, 204, 102);">)</span> == <span style="color: rgb(255, 0, 0);">'pre'</span> ||
! 						<span style="color: rgb(102, 204, 102);">(</span> htmlNode.parentNode &amp;&amp; htmlNode.parentNode.parentNode &amp;&amp; htmlNode.parentNode.parentNode.nodeName.IEquals<span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(255, 0, 0);">'pre'</span> <span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">)</span>
! 					 <span style="color: rgb(102, 204, 102);">)</span>
! 			<span style="color: rgb(102, 204, 102);">)</span>
  			<span style="color: rgb(102, 204, 102);">{</span>
  				<span style="color: rgb(0, 0, 0); font-weight: bold;">var</span> val = <span style="color: rgb(255, 0, 0);">'<span style="color: rgb(0, 0, 153); font-weight: bold;">\r</span>'</span> ;
  				<span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span> htmlNode == htmlNode.parentNode.firstChild <span style="color: rgb(102, 204, 102);">)</span>
***************
*** <span style="color: rgb(204, 102, 204);">270</span>,<span style="color: rgb(204, 102, 204);">276</span> ****
&nbsp;
  		<span style="color: rgb(128, 128, 128); font-style: italic;">// Text Node.</span>
  		<span style="color: rgb(177, 177, 0);">case</span> <span style="color: rgb(204, 102, 204);">3</span> :
! 			<span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span> htmlNode.parentNode &amp;&amp; htmlNode.parentNode.nodeName.IEquals<span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(255, 0, 0);">'pre'</span> <span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">)</span>
  				<span style="color: rgb(177, 177, 0);">return</span> this._AppendTextNode<span style="color: rgb(102, 204, 102);">(</span> xmlNode, htmlNode.nodeValue <span style="color: rgb(102, 204, 102);">)</span> ;
  			<span style="color: rgb(177, 177, 0);">return</span> this._AppendTextNode<span style="color: rgb(102, 204, 102);">(</span> xmlNode, htmlNode.nodeValue.ReplaceNewLineChars<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(255, 0, 0);">' '</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">)</span> ;
&nbsp;
--- <span style="color: rgb(204, 102, 204);">274</span>,<span style="color: rgb(204, 102, 204);">283</span> ----
&nbsp;
  		<span style="color: rgb(128, 128, 128); font-style: italic;">// Text Node.</span>
  		<span style="color: rgb(177, 177, 0);">case</span> <span style="color: rgb(204, 102, 204);">3</span> :
! 			<span style="color: rgb(177, 177, 0);">if</span> <span style="color: rgb(102, 204, 102);">(</span>
! 				<span style="color: rgb(102, 204, 102);">(</span> htmlNode.parentNode &amp;&amp; htmlNode.parentNode.nodeName.IEquals<span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(255, 0, 0);">'pre'</span> <span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">)</span> ||
! 				<span style="color: rgb(102, 204, 102);">(</span> htmlNode.parentNode &amp;&amp; htmlNode.parentNode.parentNode &amp;&amp; htmlNode.parentNode.parentNode.nodeName.IEquals<span style="color: rgb(102, 204, 102);">(</span> <span style="color: rgb(255, 0, 0);">'pre'</span> <span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">)</span>
! 			 <span style="color: rgb(102, 204, 102);">)</span>
  				<span style="color: rgb(177, 177, 0);">return</span> this._AppendTextNode<span style="color: rgb(102, 204, 102);">(</span> xmlNode, htmlNode.nodeValue <span style="color: rgb(102, 204, 102);">)</span> ;
  			<span style="color: rgb(177, 177, 0);">return</span> this._AppendTextNode<span style="color: rgb(102, 204, 102);">(</span> xmlNode, htmlNode.nodeValue.ReplaceNewLineChars<span style="color: rgb(102, 204, 102);">(</span><span style="color: rgb(255, 0, 0);">' '</span><span style="color: rgb(102, 204, 102);">)</span> <span style="color: rgb(102, 204, 102);">)</span> ;</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>対象の要素の親の親のタグがpreかどうか判断するという方法に修正しました。<br />
これで修正が完璧かというと完璧ではないと思います。</p>
<p>なのでそれぞれの環境に合うように修正して使用してください。</p>
<p>それでは、修正の反映方法です。</p>
<p><span id="more-420"></span></p>
<ol>
<li>まず、FCKEditorのルートフォルダ「fckeditor」フォルダに移動します。<br />
    （ここには「fckconfig.js」などのソースファイルが格納されています。）</li>
<li>そのフォルダから「fckeditor\editor\_source\internals」フォルダに移動します。</li>
<li>「fckxhtml.js」ファイルを開き、189～195行目、270～276行目を上記内容に修正します。</li>
<li><a href="http://svn.fckeditor.net/FCKpackager/trunk/fckpackager.exe">fckpackager.exe</a>をダウンロードしてきます<br />
    （これは、FCKEditorのソースファイルを圧縮するためのツールです。詳しくは<a href="http://www.fckeditor.net/fckpackager">こちら</a>）</li>
<li>ダウンロードしてきたファイルをfckeditorのルートフォルダにコピーします。</li>
<li>「fckpackager.exe」を実行します。</li>
<li>実行が成功すると、「fckeditor\editor\js」フォルダの「fckeditorcode_ie.js」と「fckeditorcode_gecko.js」が更新されるのでその２つのファイルをFCKEditorを使用しているフォルダにアップロードします。</li>
<li>これでFCKEditorの修正は完了です<img src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/sign03.gif" alt="" /></li>
</ol>
<p>設定方法が、もしわからん<img src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/sign02.gif" alt="" />かったら連絡もらえたら教えますよ<img src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/note.gif" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/cms/wordpress/wordpress-fckeditor-pre/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FCKEditorのプラグインGeshiProを改造</title>
		<link>http://blog.veryposi.info/programing/cms/wordpress/fckeditor-plugin-geshipro/</link>
		<comments>http://blog.veryposi.info/programing/cms/wordpress/fckeditor-plugin-geshipro/#comments</comments>
		<pubDate>Sun, 01 Feb 2009 20:37:36 +0000</pubDate>
		<dc:creator>gensan</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[fckeditor]]></category>
		<category><![CDATA[geshipro]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://blog.veryposi.info/?p=58</guid>
		<description><![CDATA[&#160; FCKEditorのプラグインGeghiProを改造しました。 行番号とソースコードをテーブル組みに変えてソースコードのみを選択コピーできるようにしました。 &#160; 例えば &#160; 1 2 3  [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>FCKEditorのプラグインGeghiProを改造しました。</p>
<p>行番号とソースコードをテーブル組みに変えてソースコードのみを選択コピーできるようにしました。</p>
<p>&nbsp;</p>
<p>例えば</p>
<p>&nbsp;</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
1
2
3
4
5
</pre>
</td>
<td class="code">
<pre class="html4strict"><span style="color: rgb(0, 153, 0);"><a href="http://december.com/html/4/element/div.html"><span style="color: rgb(0, 0, 0); font-weight: bold;">&lt;div</span></a> <span style="color: rgb(0, 0, 102);">style</span>=<span style="color: rgb(255, 0, 0);">&quot;width: 300px;&quot;</span><span style="color: rgb(0, 0, 0); font-weight: bold;">&gt;</span></span>
    <span style="color: rgb(0, 153, 0);"><a href="http://december.com/html/4/element/div.html"><span style="color: rgb(0, 0, 0); font-weight: bold;">&lt;div</span></a> <span style="color: rgb(0, 0, 102);">style</span>=<span style="color: rgb(255, 0, 0);">&quot;margin: 0px auto; width:20px; border:1px solid red;&quot;</span><span style="color: rgb(0, 0, 0); font-weight: bold;">&gt;</span></span>
        ○
    <span style="color: rgb(0, 153, 0);"><span style="color: rgb(0, 0, 0); font-weight: bold;">&lt;/div&gt;</span></span>
<span style="color: rgb(0, 153, 0);"><span style="color: rgb(0, 0, 0); font-weight: bold;">&lt;/div&gt;</span></span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<p>こんな感じです。</p>
<p>後は、スタイルシートでデザインすればOK！！</p>
<p>その他、行数を1以外からもはじめられるように修正しました。</p>
<p>&nbsp;</p>
<div class="syntax">
<table>
<tbody>
<tr>
<td class="line_numbers">
<pre>
100
101
102
103
104
</pre>
</td>
<td class="code">
<pre class="html4strict"><span style="color: rgb(0, 153, 0);"><a href="http://december.com/html/4/element/div.html"><span style="color: rgb(0, 0, 0); font-weight: bold;">&lt;div</span></a> <span style="color: rgb(0, 0, 102);">style</span>=<span style="color: rgb(255, 0, 0);">&quot;width: 300px;&quot;</span><span style="color: rgb(0, 0, 0); font-weight: bold;">&gt;</span></span>
    <span style="color: rgb(0, 153, 0);"><a href="http://december.com/html/4/element/div.html"><span style="color: rgb(0, 0, 0); font-weight: bold;">&lt;div</span></a> <span style="color: rgb(0, 0, 102);">style</span>=<span style="color: rgb(255, 0, 0);">&quot;margin: 0px auto; width:20px; border:1px solid red;&quot;</span><span style="color: rgb(0, 0, 0); font-weight: bold;">&gt;</span></span>
        ○
    <span style="color: rgb(0, 153, 0);"><span style="color: rgb(0, 0, 0); font-weight: bold;">&lt;/div&gt;</span></span>
<span style="color: rgb(0, 153, 0);"><span style="color: rgb(0, 0, 0); font-weight: bold;">&lt;/div&gt;</span></span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<p>こんな感じです。</p>
<p>よかったら使ってみてください<img src="http://blog.veryposi.info/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/typepad/happy01.gif" alt="" /></p>
<p>ダウンロードファイルは、「<a href="http://www.deanlee.cn/wordpress/fckeditor-for-wordpress-plugin/">Dean&rsquo;s FCKEditor for WordPress plugin</a>」というプラグインにGeshiProを同梱してあります。</p>
<p>インストール方法：</p>
<p><span id="more-58"></span></p>
<ol>
<li>以下のリンクからWordPressのプラグインの圧縮ファイルをダウンロードします。</li>
<li>ダウンロードした圧縮したダウンロードファイルを解凍します。</li>
<li>解凍してできたフォルダをWordPressのプラグインのフォルダにまるごとアップロードします（「wp-content\plugins」へアップロード)</li>
<li>WordPressの管理画面から「Dean&#8217;s FCKEditor For WordPress」のプラグインを有効にします。</li>
<li>これで完了です。</li>
</ol>
<p>あとは、新規作成ボタンを押下するとFCKEditorが立ち上がるので、</p>
<p><a href="http://blog.veryposi.info/wp-content/uploads/2009/02/geshipro.jpg" rel="lightbox[58]"><img height="88" width="300" class="aligncenter size-medium wp-image-60" title="geshipro" alt="geshipro" src="http://blog.veryposi.info/wp-content/uploads/2009/02/geshipro-300x88.jpg" /></a></p>
<p>このアイコンをクリックするとGeshiProの改造版が使用できます。</p>
<p>ダウンロードファイル：<a href="http://blog.veryposi.info/wp-content/uploads/2009/02/fckeditor-for-wordpress-plugin.zip">GeshiPro(改造版)</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.veryposi.info/programing/cms/wordpress/fckeditor-plugin-geshipro/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: blog.veryposi.info @ 2026-04-27 15:39:29 -->