返回介绍

Link Checker plugin

发布于 2019-05-06 06:50:31 字数 2741 浏览 1000 评论 0 收藏 0

The linkchecker does what it says – validates URLs, as you type them. URLs considered invalid will be highlighted with red and will have a dedicated context menu with options to either edit the link, try and open it in a separate tab, remove the link, or ignore it.

Please note that Link Checker is a premium plugin and relies on a server-side service, which is included as a part of a premium TinyMCE plugin subscription.

Cloud Instructions

If you are using TinyMCE Cloud, simply add "linkchecker" to your plugins list, and the service will be automatically configured.

Example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "linkchecker"
});

Self-hosted Instructions

Customers using a Self-hosted environment will need to provide a URL to their deployment of the link checking service via the linkchecker_service_url parameter

Example
tinymce.init({
  selector: "textarea",  // change this value according to your HTML
  plugins: "linkchecker",
  linkchecker_service_url: "http://mydomain.com/linkchecker"
});

Options

Link Checker has the following settings.

linkchecker_content_css

After a link is checked for validity, a result of the validation is added to it via data-mce-linkchecker-status attribute. There are three possible outcomes of the validation: valid, invalid and unknown. Link Checker visually reflects invalid outcome by injecting the following CSS styles into the editor:

a[data-mce-linkchecker-status="invalid"] {
    outline-color: rgba(231, 76, 60, 0.25);
    background-color: rgba(231, 76, 60, 0.25)
}

a[data-mce-linkchecker-focus="true"] {
    outline: 1px solid rgba(231, 76, 60, 0.75)
}

data-mce-linkchecker-focus attribute is set to true every time a dedicated context menu is shown on a link. This only happens for invalid links.

It is possible to replace or extend those styles, by providing a URL to custom stylesheet via linkchecker_content_css option.

linkchecker_service_url

A URL of the server-side link validation service. This is required option, without it plugin will fail to operate and will throw a corresponding warning on the screen.

Type: String

Example
tinymce.init({
    selector: "textarea",
    plugins: "linkchecker",
    linkchecker_service_url: "http://mydomain.com/linkchecker"
});

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文