tinymce将bbcode转换为HTML代码

时间:2017-05-11 09:42:32

标签: extjs tinymce tinymce-4 extjs6 bbcode

我希望我的tinymce将bbcode转换为html代码。我在Extjs 6中添加了tinymce。当我想制作Bold时,它会在html代码[b]中写入我的内容,它是相同的:italic,underlined,size。 我关注此链接但它也不起作用:Convert BBcode to HTML using JavaScript/jQuery 怎么可以改变,因为它在我的网站上显示如下: [b]测试[/ b]而不是测试 这是我的代码:

tinyMCEConfig: {
                                content_style: "iframe { width:100%}",

                                plugins : [
                                  'advlist anchor autolink autoresize autosave bbcode charmap link code image imagetools codesample contextmenu colorpicker code lists charmap print  hr anchor pagebreak spellchecker',
                                  'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking example fullscreen importcss media ',
                                  'save paste preview table template textcolor textpattern  visualblocks visualchars wordcount searchreplace spellchecker tabfocus contextmenu directionality emoticons template textcolor  textpattern insertdatetime layer lists'
                                ], 
                                menubar: 'insert edit view',

                                image_advtab: true ,

                                external_filemanager_path:"/ext/ux/newtinymce/js/responsive_filemanager/filemanager/",
                                filemanager_title:"Responsive Filemanager" ,
                                external_plugins: { "filemanager" : "/ext/ux/newtinymce/js/responsive_filemanager/filemanager/plugin.min.js"},
                                toolbar1: 'responsivefilemanager bold italic underline strikethrough alignleft aligncenter alignright alignjustify numlist bullist anchor ',
                                toolbar2: 'code codesample preview hr  textcolor fullpage textpattern  layer lists emoticons media image imagetools fontsizeselect fontselect',
                                toolbar3: 'ltr rtl visualblocks  searchreplace insertdatetime nonbreaking fullscreen indent pagebreak template ',
                                toolbar4: 'save cancel pastetext paste  print table  importcss  textcolor  backcolor  textpattern wordcount   lists  contextmenu restoredraft bbcode  charmap link instagram',
                                bbcode_dialect: "punbb",
                                autoresize_max_height: 50,
                                fontsize_formats : "8pt 8.25pt 8.5pt 8.75pt 9pt 9.25pt 9.5pt 10pt 11pt 12pt 14pt 18pt 24pt 36pt",
                                font_formats: 'Schriftart=Schriftart;Microsoft Sans Serif=Microsoft Sans Serif;Sans-serif = sans-serif;Andale Mono=andale mono,times;Arial=arial, helvetica, sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua; Palatino = palatino;'+
                                'Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;'+
                                'Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif; Serif = serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;'+
                                'Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats',
                            }

1 个答案:

答案 0 :(得分:0)

你启用了 PunBB.INFO→管理→设置→功能 选项

消息选项在帖子中允许BBCode(推荐)。