[英]CKEditor 5 function to toogle headlines on/off
Is there a CKEditor 5 function to toggle paragraphs to headlines. 是否有CKEditor 5函数将段落切换到标题。 So that if you activate it once, it makes the current paragraph to a headline, and if you click it again, it converts the headline back to a normal paragraph again. 这样,如果您一次激活它,它将使当前段落成为标题,并且如果再次单击它,它将再次将标题转换回普通段落。
For example, if I execute("numberedList") once, the current paragraph is converted to a list, and if I execute("numberedList") again, the list is converted back to a normal paragraph. 例如,如果我执行一次(“ numberedList”),则当前段落将转换为列表,如果我再次执行(“ numberedList”),则列表将转换回普通段落。 Is there a similar command for headlines? 头条新闻有类似的命令吗?
There is a heading command, that works similarly. 有一个标题命令,其工作原理类似。 However, it does not toggle - you need to set to what element you want to rename. 但是,它不会切换-您需要设置要重命名的元素。 Call editor.execute( 'heading', { value: elementName } );
调用editor.execute( 'heading', { value: elementName } );
. 。 elementName
can be a paragraph
or any of the headings: heading1
, heading2
, etc. elementName
可以是一个paragraph
或任何标题: heading1
, heading2
等。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.