我的tineMCE发生了一件非常奇怪的事情。
如果我在哈希标记之间键入粗体,例如#Text#
并按Enter键,它会删除第一个哈希标记并增加字体大小。有人有这个问题吗?
tinymce.init({
selector: '#mytextarea',
theme: 'modern',
skin: 'lightgray',
menubar: false,
branding: false,
plugins: [
"advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"table contextmenu directionality emoticons template textcolor paste fullpage textcolor colorpicker textpattern",
"pagebreak"
],
setup: function (editor) {
},
toolbar1: "newdocument fullpage | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect formatselect fontselect fontsizeselect",
toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | link unlink anchor | insertdatetime preview | forecolor backcolor",
toolbar3: "table | hr removeformat | subscript superscript | charmap | print fullscreen | ltr rtl | spellchecker | visualchars visualblocks | pagebreak",
init_instance_callback: "renderEditor",
height: "300"
});
答案 0 :(得分:2)
您正在加载textpattern
插件,该插件将第一个#
解释为降价。
https://www.tinymce.com/docs/plugins/textpattern
如果您不希望编辑器将文本解释为markdown,请不要加载该插件。
在您的特定示例中,前导#
正在变为H1标记,因此文本会变大,因为根据传递给编辑器的CSS,H1可能会大于P。