You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Tinymce富文本编辑器输入内容反向显示问题求助

问题解答

是的,这个问题大概率是编辑器默认启用了**从右到左(RTL)**的输入方向导致的。你可以通过修改TinyMCE的初始化配置来解决:

  1. 在编辑器的init配置中添加directionality: 'ltr',强制设置文本输入方向为从左到右:
init={{
    initialValue: defaultValue,
    height: 500,
    menubar: true,
    directionality: 'ltr', // 新增配置强制左到右输入
    plugins: [
        "image",
        "advlist",
        "autolink",
        "lists",
        "link",
        "image",
        "charmap",
        "preview",
        "anchor",
        "searchreplace",
        "visualblocks",
        "code",
        "fullscreen",
        "insertdatetime",
        "media",
        "table",
        "code",
        "help",
        "wordcount",
        "anchor",
    ],
    toolbar:
    "undo redo | blocks | image | bold italic forecolor | alignleft aligncenter bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent |removeformat | help",
    content_style: "body { font-family:Helvetica,Arial,sans-serif; font-size:14px }"
}}
  1. 如果需要支持手动切换输入方向,可以在工具栏中添加rtl和ltr按钮:
toolbar:
"undo redo | blocks | image | bold italic forecolor | rtl ltr | alignleft aligncenter bold italic forecolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent |removeformat | help",

内容的提问来源于stack exchange,提问作者Tarun Tiwari

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 13:38:19