简体   繁体   English

如何在tinymce文本编辑器下打开新窗口中的超链接?

[英]How to open hyperlink in new window under tinymce text editor?

I have below configuration for tinymce. 我有以下配置为tinymce。 I want to open the result of hyperlink click in separate tab or window. 我想在单独的选项卡或窗口中打开超链接的结果。 I used theme_advanced_link_targets : "_blank" as shown below but did not help. 我使用了theme_advanced_link_targets : "_blank" ,如下所示,但没有帮助。 Is there any other cofig paramter for this? 还有其他任何一个cofig参数吗?

  var tinyMCESettings = {
    theme : "advanced",
    plugins : "preview",
    readonly : readOnly,
    theme_advanced_buttons1 : "forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull",
    width : width,
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "false",
    theme_advanced_link_targets : "_blank",
    forced_root_block : false,
    relative_urls : false,
    remove_script_host : false
  }

For TinyMCE 4.0.23 you can use the (undocumented) option: 对于TinyMCE 4.0.23,您可以使用(未​​记录的)选项:

default_link_target:"_blank"

as is: 原样:

tinymce.init({
    selector: "textarea.rta",
    auto_focus: rta_auto_focus,
    forced_root_block : false,
    statusbar:  false,
    menubar:    false,
    content_css : "content.min.css",
    plugins: [
        "autolink lists link autoresize",
        "searchreplace code",
        "paste"
    ],
    default_link_target:"_blank",
    toolbar: "undo redo | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link"
});

用参数解决了

    extended_valid_elements : "a[href|target=_blank]"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM