简体   繁体   English

如何防止froala编辑器格式化我的代码视图html?

[英]How to prevent the froala editor to format my code view html?

i am using froala editor, however when i put this html code in the code view 我正在使用froala编辑器,但是当我将此html代码放在代码视图中时

<td><a href="https://www.facebook.com/GSCinemas/videos/10155007044777275/" target="_blank"><img src="http://edm.gsc.com.my/WebLITE/Applications/campaignmgmt/uploaded/pics/2017/gsc-edm-july2017/masthead-gsc30.jpg" width="280" height="110" alt="#GSC30" title="#GSC30" class="img-max" style="display:block;"></a></td>

it become, 变成了

<!DOCTYPE html>
<html>
    <head>
        <title></title>
    </head>
    <body style="min-height: 300px;">

        <p>
            <a href="https://www.facebook.com/GSCinemas/videos/10155007044777275/" target="_blank"><img src="http://edm.gsc.com.my/WebLITE/Applications/campaignmgmt/uploaded/pics/2017/gsc-edm-july2017/masthead-gsc30.jpg" width="280" height="110" alt="#GSC30" title="#GSC30" class="img-max fr-fil fr-dib"></a>
        </p>
    </body>
</html>

i dont want it to help me to format anything, how can i disable the froala editor to format anything for me? 我不希望它帮助我格式化任何内容,如何禁用froala编辑器为我格式化任何内容?

It looks like you are using the fullPage option: https://www.froala.com/wysiwyg-editor/docs/options#fullPage . 看来您正在使用fullPage选项: https : fullPage When this option is used, the editor is automatically adding HTML , HEAD and BODY tags. 使用此选项时,编辑器会自动添加HTMLHEADBODY标记。

To disable wrapping the a with P tags, you should also turn the enter option to $.FroalaEditor.ENTER_BR : https://www.froala.com/wysiwyg-editor/docs/options#enter . 要禁用使用P标签包装a ,还应将enter选项变为$.FroalaEditor.ENTER_BRhttps : $.FroalaEditor.ENTER_BR

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

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