From 00dfed2d6e362668ca5b6c1c7bbe8893db9b3b99 Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 5 Nov 2018 13:10:14 -0500 Subject: [PATCH] Don't remove empty anchor tags in CKEditor --- .../views/widgets/ckeditor/core/htmlparser/fragment.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/system/application/views/widgets/ckeditor/core/htmlparser/fragment.js b/system/application/views/widgets/ckeditor/core/htmlparser/fragment.js index 38d4275eb..847e999fd 100644 --- a/system/application/views/widgets/ckeditor/core/htmlparser/fragment.js +++ b/system/application/views/widgets/ckeditor/core/htmlparser/fragment.js @@ -61,8 +61,13 @@ CKEDITOR.htmlParser.fragment = function() { if ( node.attributes[ 'data-cke-survive' ] ) return false; - // Empty link is to be removed when empty but not anchor. (https://dev.ckeditor.com/ticket/7894) - return node.name == 'a' && node.attributes.href || CKEDITOR.dtd.$removeEmpty[ node.name ]; + // Empty link is to be removed when empty but not anchor. (http://dev.ckeditor.com/ticket/7894) + + if(node.name == 'a'){ + return false; + } + + return CKEDITOR.dtd.$removeEmpty[ node.name ]; } /**