当前位置: 首页 > 文档资料 > tinyMCE 帮助文档 >

Advanced editing behaviors

优质
小牛编辑
122浏览
2023-12-01

br_in_pre

This option allows you to disable TinyMCE’s default behavior when pressing the enter key within a pre tag. By default, pressing enter within a pre tag produces a br tag at the insertion point. For example:

<pre>This is inside <br> a pre tag.</pre>

However, when br_in_pre is set to false, rather than inserting a br tag TinyMCE will split the pre tag. For example:

<pre>This is inside </pre> <pre>a pre tag.</pre>

Note: when set to false, shift+enter will insert a br tag.

Type: Boolean

Default Value: true

Possible Values: true, false

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  br_in_pre: false
});

custom_undo_redo_levels

This option should contain the number of undo levels to keep in memory. By default, it is set to use an unlimited number of undo levels. The value of custom_undo_redo_levels should be 10 or lower for low-end systems otherwise it steals a lot of memory.

Type: Number

Default Value: unlimited

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  custom_undo_redo_levels: 10
});

end_container_on_empty_block

This option allows you to to split the current container block element if the enter key is pressed inside an empty inner block element.

Type: Boolean

Default Value: false // confirmation required

Possible Values: true, false

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  end_container_on_empty_block: true
});

nowrap

This option makes the editable area behave like a <pre> tag, and adds a horizontal scroll instead of wrapping text.

Type: Boolean

Default Value: false

Possible Values: true, false

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
	nowrap : true
});

object_resizing

This options allows you to turn on/off the resizing handles on images, tables or media objects. This option is enabled by default and allows you to resize table and images. You can also specify a CSS3 selector of what you want to enable resizing on.

Disable all resizing of images/tables

Type: Boolean, String

Default Value: true

Possible Values: true, false, img

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  object_resizing : false
});

Enable resizing on images only

Type: Boolean, String

Default Value: true

Possible Values: true, false, img

Example
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  object_resizing : 'img'
});

typeahead_urls

This option allows disable the type ahead url field feature.

Type: Boolean

Default Value: true

Possible Values: true, false

Example
tinymce.init({
  selector: 'textarea',
  typeahead_urls: false
});