Jump to content

How to add irc:// link in CKEditor?


Roadwolf
 Share

Recommended Posts

  • 2 months later...

I am sorry.  My initial posting, was in reference to the inline editor.  CK Editor?   While composing a post.   I attempted to create a hyperlink direct to an IRC server.  But it auto filled http://  and did not allow me to edit it to say irc://

Link to comment
Share on other sites

OK I see, so to resume: you create a link in a CKEditor, put "irc://foobar" as link and after saving the page the link is removed, probably because CKEditor only allows http links.

I don't know how to solve this yet, but now that the question is clear, someone else may help. 🙂

You should edit this topic title to something like: "How to add irc:// link in CKEditor?".

Link to comment
Share on other sites

  • Roadwolf changed the title to How to add irc:// link in CKEditor?

@Roadwolf

I had a look in InputfieldCKEditor.module source code, and found this is related with HTML purifier. You can disable this feature in your field configuration > Field tab > Use HTML purifier, but that may not be recommended in some cases (read the option description).

I don't have time to investigate more but this is related to HTMLPurifier class and probably one of the classes it uses to purify HTML. So maybe you can use this information to investigate or report an issue.

Link to comment
Share on other sites

@Roadwolf, HTML Purifier doesn't include irc:// in its allowed URI schemes. PW does provide some ability to hook into the HTML Purifier configuration via MarkupHTMLPurifier::initConfig but in the case of adding a scheme this seems difficult to achieve. The MarkupHTMLPurifier::initConfig method is only called when there is no cached configuration for HTML Purifier and yet the cached config doesn't seem to include the relevant "URI.AllowedSchemes" setting. So you'd need to be continuously clearing the cached config. Plus you would also need to include a custom class to validate the irc:// scheme so it's available to HTML Purifier.

All in all it would be a lot easier just to use a Hanna code for IRC links when you need them, e.g. [[irc_link uri="irc://irc.efnet.org/mIRC" text="My link text"]]. In the Hanna code you would use the uri and text attributes to output the link.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...