Roadwolf Posted November 24, 2023 Posted November 24, 2023 I am attempting to add a url for an irc;//<domain> in place of a normal http link, on a page in my Classic site profile, and every time I do and save the page, it removes the formatting. Can this be changed?
Roadwolf Posted February 1, 2024 Author Posted February 1, 2024 I totally forgot I even posted this question. I think it would be neat to add it on the main sidebar. I doubt I could embed it onto the sidebar, but a link would be cool.
da² Posted February 1, 2024 Posted February 1, 2024 @Roadwolf By "where" I mean: in which field? And what is the formatter used by this field? And could you show the text you enter and the text you get after saving the page?
Roadwolf Posted February 1, 2024 Author Posted February 1, 2024 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://
da² Posted February 1, 2024 Posted February 1, 2024 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?".
da² Posted February 1, 2024 Posted February 1, 2024 @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.
Robin S Posted February 1, 2024 Posted February 1, 2024 @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. 1
Roadwolf Posted February 2, 2024 Author Posted February 2, 2024 That is very interesting that it is so difficult to achieve this. But thank you for the suggestion of using the Hanna code extension. I shall try it out. :)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now