繁体   English   中英

标记内容充满<span>标签</span>

[英]cleditor content riddled with <span> tags

我正在使用cleditor作为WordPress插件中的Rich Text编辑器选择。

但是,似乎是随机的,它决定在我的内容中插入<span class="Apple-style-span">

我已经完成了一个快速的Google cleditor ,而ckeditor却找不到任何东西,但是ckeditor显然在Webkit浏览器上也有类似的错误 -我网站上的两个内容作者都使用Google Chrome。 这已被记录为webkit的错误

除了在内容的保存或查看上进行PHP str_replace ,还有谁知道如何解决此问题?

这是输出示例:

<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>

提前致谢,

这是一个“功能”,在javascript中调用execcommand时会出现(在不同的浏览器中会有不同的结果),在http://www.quirksmode.org/dom/execCommand.html上有帮助地进行了总结

我不知道是否可以在浏览器中规避它,但是我对此表示怀疑。 最好的方法是使用lxml或BeautifulSoup在后端削减“有害” HTML类。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM