gpt4 book ai didi

javascript - 小MCE4 : How to change Enter key functionality to Shift + Enter key?

转载 作者:行者123 更新时间:2023-11-28 17:35:50 25 4
gpt4 key购买 nike

在 TinyMCE4 中按 Enter 时,会创建一个新段落。有什么方法可以更改 TinymCE4 的配置,以便 Enter 应该像 Shift+Enter 一样工作?

Enter键后,我想要一个<br/>标签而不是 <p>标签。

最佳答案

是的,有一个选项。这是forced_root_block .

来自docs :

This option enables you to make sure that any non block elements ortext nodes are wrapped in block elements. For example something willresult in output like: <p><strong>something</strong></p>. This optionis enabled by default as of 3.0a1.

If you set this option to falseit will never produce p tags on enter or automatically it will insteadproduce br elements and Shift+Enter will produce a p.

不过,您还应该注意文档中的警告:

Note that not using p elements as root block can severely cripple thefunctionality of the editor.

关于javascript - 小MCE4 : How to change Enter key functionality to Shift + Enter key?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49140515/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com