1

私はWordPressプラグインで選択したリッチテキストエディターとしてcleditorを使用しています。

しかし、一見ランダムに見えますが<span class="Apple-style-span">、私のコンテンツに挿入することにしました。

cleditor簡単なGoogleを実行しましたが、何も見つかりませんでしたが、Webkitブラウザで同様のバグckeditorがあったようです。私のWebサイトのコンテンツ作成者は両方ともGoogleChromeを使用しています。これは、webkitのバグとして記録されています。

str_replaceコンテンツの保存または表示でPHPを実行する以外に、この問題を解決する方法を知っている人はいますか?

出力の例を次に示します。

<h2 id="notes" class="profile_notes">Notes</h2>
<p>
    <span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">
        <div>
            This species is assigned the codes A220, A221 and A222 under the DATZ 'A' number system with these referring to similar-looking, possibly conspecific, populations. These differ in some aspects of colour pattern, particularly the orientation of the caudal-fin markings which may be horizontal, vertical, or somewhere inbetween.
        </div>
        <div>
            <br>
        </div>
        <div>
            One population displays an orange colouration on the belly and is sometimes referred to as A. mendezi 'orange' (A222) while another known as A. sp. 'fork-band' or 'gabelband' and collected in the rio Jaú may also represent a form of A. mendezi.
        </div>
        <div>
            <span class="Apple-style-span" style="background-color: rgb(255, 255, 255); ">
                <br>
            </span>
        </div>
            Apistogramma&nbsp;is...
        </div>
    </span>
</p>

前もって感謝します、

4

1 に答える 1

1

これは、JavaScriptで呼び出されたときに表示される「機能」であり、 http:execcommand //www.quirksmode.org/dom/execCommand.htmlに要約されています。

これがブラウザで回避できるかどうかはわかりませんが、疑わしいです。最善のアプローチは、lxmlまたはBeautifulSoupを使用してバックエンドの「問題のある」HTMLクラスをカットすることです。

于 2012-04-08T11:40:49.690 に答える