The Ponk Room Blog

Dated Title (Click to show)
2021-08-22 Raspberry Pi
2021-08-18 Vintage or Obsolete ?
2021-07-22 IFrames
2021-07-21 Placing images and captions
2021-07-19 HTML Text Editors
2021-07-14 Le Jardin
2021-07-08 Synology releases Version 7 of DSM
2021-07-04 England have been playing football
2021-07-01 To Vax or not to Vax ?
2021-06-22 Up To Date and a few moans
2013-11-10 Joomla
2013-11-10 Wordpress
2013-11-10 Try a VPS
2012-11-28 Mostar Bridge
2012-04-24 Fords smallest car

About The Blog

The list above shows tha last 15 entries. I'll probably change the selection method to a date based system once there are a few more entries. Click an entry title to see it.

This is the blog which used to be on another of my websites, now defunct ( The last post was 8 years ago I moved it here without any problems. The editing functions have been brought up to date, so I can now add new entries and upload pictures. The display code (text) has been updated too e.g. the broken links are either removed or fixed.

25th June 2021

HTML Text Editors   

Posted On: 2021-07-19 11:39:42

Is CK Editor the best choice ?

If you are going to write a "real time blog"  - edit it live -  so to speak, rather than edit the pages "off line" then youCK Edito 4 Logo need an HTML text editor. It runs inside your web browser and lets you add text and pictures in real time to a web page,. 12 years or so ago  when this blog first started and I was learning how to do it, I discovered an HTML Editor called CK Editor. Back then it was V2. The current version is V4.16.  It's free - simply because the very latest all singin' and dancin' version is V5 and although the V5 core is free, there are lots of plugins you need ( for image handling, for example ) which are not free

It does a lot of things very well and at "free" it is a bargain.. There is a lot of documentation, but it sort of goes round in a circle and you end up back where you started, none the wiser, and in my case, totally confused,  after 2 hours reading.


Now one of the weird things it does , and has always done, is very irritating. It is a bug, and no attempt has been made to fix it, as far I know.. Whenever you save your work, it adds a paragraph containing a non breaking space at the beginning and end of the text. Why ?  What is it for ?  Why can't you disable it ?  It seems like such an easy thing to fix. After two or three saves, you have to manually delete them, otherwise the block of  text has what appears to be large margins at the top and bottom.. There are many, many queries about this on many different forums. Some folks say it is the fault of the browser ( I think this is put about by the CK team to stop people complaining,!) There  are many other theories and many suggested changes to the config file, but I could not make any of them work. Some of them needed software tools which I do not have,.

There are many other HTML editors ( eg TinyMCE (which is used by Wordpress & Joomla)  and ContentTools ) out there, but I have a sort of affection now for CK Editor. So I fixed it by using the PHP str_replace() function to strip the offending additions out of the text on its' way to the database for safe keeping. Works a treat. But then I did a point upgrade and my fix stopped working. Now it  just puts an opening and closing paragraph tag. So now I strip thise out too.

There are many other funnies too which you get used to after a while. There are plugins offered which give more functionality to image handling. One adds captions for example. But you trade off not being able to set margins around the image Why do they do that ? Add a very useful caption function but take away the ability to set margins on the image ( amongst other things ) ? It looks horrible with the text squashed up against the image I tried using styles on the div which surrounds the image but I cannot make it work.   It must be possible. The profuse documentation says nothing abut this. I need to build an off-line test page and play with it.

You know after reading the above paragraphs I wonder why I continue to use CKEditor !. But Version 4.16 ( Full)  ( the one without the image caption) works well for most things and is what I am using to write this blog

 I'll see how I get on with the testing. Update: Look at the next blog entry for one answer to this problem

A tip

Put a submit button at the bottom of the editor text box. Saves you having to continually scroll back to the top when you want to save something