Post by mikeinterserv » Thu May 28, 2020 7:10 am

There is a very bad bug / behaviour when trying to add a css background with an inline stylesheet.
as
<div style="color:#fff;background-image: url("image/catalog/barback.png");"></div>
If you add this div in code view when you save or return to edit view it completely destroys any other image tags etc
I am guessing the brackets with quotes is causing the issue however I could find no workaround whatsoever
It is very bizarre what the code editor does to the file.
It turns it into this
<div style="background-color:#666;color:#fff;background-image: url(" img="" catalog="" barback.png";="">
It is seriously messed up I do not understand how or why this should happen in code editing.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by Johnathan » Thu May 28, 2020 9:36 pm

You're using double-quotes within double-quotes, which is why it's probably breaking. You'd need to either leave the internal set of quotes out, or use single-quotes. For example:

Code: Select all

<div style="color:#fff; background-image: url('image/catalog/barback.png');"></div>

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by mikeinterserv » Thu May 28, 2020 11:36 pm

As I said I could not find a workaround I tried every combination of single quotes, double quotes and no quotes
If you try it you will see - It saves in every case but completely destroys the code. Why does the editor interfere at all when using code edit.
You cannot save from code edit so you switch back to save and thats when it breaks.
When using single quotes which was my first guess it doesn't break the code the same but the image will not display - on any browser
The image is just not there - The only workaround I used was to create an image div and position text on top. But this breaks when viewing on ipad
All you have to do to reproduce is make html module place on page. Now edit and add this
<div style="height:60px;background-color:#666;color:#fff;font-size:24px;background-image url("image/catalog/barback.jpg");">
Then try any combination of anything you want to get the image to display - It won't and or the code will break especially if there is more code and an image tag following on

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by ADD Creative » Fri May 29, 2020 4:24 am

Single quotes or no quotes worked for me. The image was displayed as expected. There is another bug in Summernote, in that it won't save in code view, which doesn't help. viewtopic.php?f=202&t=217795#p787062

It's looks like Summernote is being replaced with CKEditor in future versions. You might also find some replacement editors in the marketplace.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by mikeinterserv » Fri May 29, 2020 5:53 am

Absolutely not possible for me with version 3.0.3.2 in any way at all

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by letxobnav » Fri May 29, 2020 10:57 am

I just correct the summernote "we know best" nonsense by adding

Code: Select all

$value['description'] = html_entity_decode($value['description']);
just before adding or updating the product description into the database.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan
Who is online

Users browsing this forum: No registered users and 55 guests