Tinymce在制表符上按下:同一行中的符号

问题描述 投票:1回答:1

我正在使用tinymce编辑器,我想要的是用户之前按Tab键的时间:符号应该是字符串对齐的。作为参考,请检查屏幕截图。enter image description here

tinyMCE.init({
    selector: 'textarea',
    indentation : '60pt',
    plugins: 'textcolor print preview importcss searchreplace autolink autosave save directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable',
    paste_as_text:true,
    //menubar: false,
    toolbar: 'bold italic underline strikethrough superscript subscript | fontselect fontsizeselect | alignleft aligncenter alignright alignjustify | outdent indent |  numlist bullist checklist | forecolor backcolor',
    nonbreaking_force_tab: true

});
javascript jquery html tinymce editor
1个回答
0
投票

[您需要添加一个名为“ nonbreaking”的插件,此插件在当前插入符号位置添加了一个用于插入不间断空间实体的按钮。

并将nonbreaking_force_tab的值设置为true,此选项可让您在用户按下键盘Tab键时强制TinyMCE插入三个实体。

tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "nonbreaking",
  nonbreaking_force_tab: true
});

请在此处找到工作示例-http://fiddle.tinymce.com/Sehaab

nonbreaking_force_tab设置可以破坏以下功能:

  1. 表插件使用Tab键在表单元格之间导航。
  2. 列表插件使用Tab键进行项目缩进。

要保留列表或表插件的Tab键功能,请在init配置的不中断插件之前添加表或列表插件,例如:

tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "table lists nonbreaking",
  nonbreaking_force_tab: true
});

文档链接-https://www.tiny.cloud/docs/plugins/nonbreaking/

© www.soinside.com 2019 - 2024. All rights reserved.