Lastwolf Posted February 6, 2018 Share Posted February 6, 2018 <i class="fa fa-arrow-circle-right" aria-hidden="true"></i> I have that in one of my descriptions, if I save while still in "Source" it'll work just fine, as long as I never try to preview it, which means if I view it to edit, it's gone again. Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted February 6, 2018 Share Posted February 6, 2018 It can be a pain as it removes html that your browser doesn't think is valid. It might be worth asking at the CKEditor website as there will be more specialists there. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 6, 2018 Share Posted February 6, 2018 (edited) I am looking at the CKEditor API docs, specifically the Advanced Content Filter (ACF) to determine the pattern rule that the editor will accept. The rule will either be that characters are required between the open and close tags, or the element has disallowed any attributes, styles, and/or classes. It is probably a combination of both. On the other hand, the editor's config.js file specifically sets 'allowedContent' to "true", and this (supposedly) switches off the filtering - allowing anything to be entered. On the third hand, the ACF filters "pasted" content from the clipboard. Content already present (loaded on editor initialization or currently being edited) is managed by other sets of rules. Edited February 6, 2018 by bsmither Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 6, 2018 Share Posted February 6, 2018 Try this: In includes/ckeditor/config.js, at the bottom, find: config.allowedContent = true; }; Change to: config.allowedContent = true; config.coreStyles_italic = {element : 'em'}; config.extraAllowedContent = 'i[*]{*}(*)'; }; CKEDITOR.dtd.$removeEmpty = '{i: 0}'; The same added statements can be used for other HTML tags used in unorthodox ways. 2 Quote Link to comment Share on other sites More sharing options...
Lastwolf Posted February 7, 2018 Author Share Posted February 7, 2018 (edited) Yeah, that does the trick, thanks, as always bsmither you are a font of problem solving. On using it more, it's doing some weird things, but it's workable, for some reason it keeps hard forcing a linebreak like a <br> but not visable anywhere. I looked for solutions on ckeditor forums, but they seem to really break it hard and it just spams every blank space with the <i class Edited February 7, 2018 by Lastwolf 1 Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted February 7, 2018 Share Posted February 7, 2018 Well done @bsmither! Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 7, 2018 Share Posted February 7, 2018 Could you better explain the linebreak issue? And I do not understand the last sentence. Quote Link to comment Share on other sites More sharing options...
Lastwolf Posted February 8, 2018 Author Share Posted February 8, 2018 I was talking nonsense, so it's not surprising you didn't understand. It was another part of my css that wasn't set to "display: inline;" so it was sitting below where I wanted. Quote Link to comment Share on other sites More sharing options...
foz1234 Posted June 22, 2018 Share Posted June 22, 2018 Surprised this edit was not added to 6.2.1 Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted June 22, 2018 Share Posted June 22, 2018 Just now, foz1234 said: Surprised this edit was not added to 6.2.1 Nobody raised an issue on GitHub. If they did it didn't make the release for whatever reason. Quote Link to comment Share on other sites More sharing options...
foz1234 Posted June 22, 2018 Share Posted June 22, 2018 the above edit no longer seems to work in 6.2.1, when i add google AdSense script into a source page/box it changes the code after save from this:- <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- Right Box #3 content --> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-xxxxxxxxxxx" data-ad-slot="2445020xxx" data-ad-format="auto"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> to this <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><!-- Right Box #3 content --><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> using the above edit in 6.1.x seemed to work and it saved the code as is Quote Link to comment Share on other sites More sharing options...
foz1234 Posted June 24, 2018 Share Posted June 24, 2018 Has anyone else tested this? Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 24, 2018 Share Posted June 24, 2018 The above solution was for a specific situation (<i> tags used for Font Awesome). Please determine if the technical docs for this "adsbygoogle" require the use of the <ins></ins> tag pair. If not, try using a <div></div> tag pair. Quote Link to comment Share on other sites More sharing options...
foz1234 Posted June 24, 2018 Share Posted June 24, 2018 Hi Brian, I posted about this previously and you recommended looking at this thread here On previous version the edit worked but no longer seems to work in 6.2.1 Quote Link to comment Share on other sites More sharing options...
bsmither Posted June 24, 2018 Share Posted June 24, 2018 I have yet to install CC621, but a CC620 installation gets me this: <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><!-- Right Box #3 content --> <p><ins class="adsbygoogle" data-ad-client="ca-pub-xxxxxxxxxxx" data-ad-format="auto" data-ad-slot="2445020xxx" style="display:block"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script></p> This is after having made the edits to config.js as described earlier. Specifically, the $removeEmpty being switched off. (Since a change has been made to this file, be sure to force your browser to reload it - usually with CTRL-F5.) Note that CKEditor still wants to wrap things in <p></p> tags. Quote Link to comment Share on other sites More sharing options...
foz1234 Posted June 25, 2018 Share Posted June 25, 2018 Hi Brian, sorry mate it must have been a cache issue just opened it this morning and now the code is showing correctly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.