gpt4 book ai didi

javascript - Tinymce 格式的内容未从数据库中显示

转载 作者:行者123 更新时间:2023-11-29 20:41:39 24 4
gpt4 key购买 nike

嗨,我在单页中有很多tinymce编辑器。当我在tinymce中格式化内容并将其保存到数据库中时。所有标签都保存在mysql中。但是在编辑时,我从数据库获取数据,但一些tinymce(不是全部)无法读取标签,并且它显示的内容没有格式化。我的初始化是:

  tinymce.init({
selector: "textarea", theme: "modern", width: "100%", height: 300,
plugins: [
"advlist autolink link image lists charmap print preview hr anchor pagebreak",
"searchreplace wordcount visualblocks visualchars insertdatetime media nonbreaking",
"table contextmenu directionality emoticons paste textcolor responsivefilemanager code",
"paste"
],
paste_retain_style_properties: "all",
toolbar1: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | styleselect",
toolbar2: "| responsivefilemanager | link unlink anchor | image media | forecolor backcolor | print preview code ",
image_caption: true,
image_advtab: true,
external_filemanager_path: "<?php echo base_url(); ?>" + "tinymce/file_manager/filemanager/",
filemanager_title: "Responsive Filemanager",
external_plugins: {"filemanager": "<?php echo base_url(); ?>" + "tinymce/file_manager/filemanager/plugin.min.js"},
document_base_url : "<?php echo base_url(); ?>",
relative_urls : false,
remove_script_host : false,
});

最佳答案

必须进行某种过滤或清理。

从数据库获取数据后,您可能会使用strip_tags

关于javascript - Tinymce 格式的内容未从数据库中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38613250/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com