The default Full HTML Text Format uses CKEditor plugin but doesn't display images. Below is an example of the HTML I am using and what it looks like in source. Any idea what could be preventing the display?

HTML

<img src="sites/default/files/test-image3.jpg">

<img src="/sites/default/files/test-image3.jpg">

Source

<p>&lt;img src="sites/default/files/test-image3.jpg"&gt;</p>

<p>&lt;img src="/sites/default/files/test-image3.jpg"&gt;</p>

Comments

sachinsuryavanshi’s picture

Hello,

Could you try this on fresh local setup?

I can see image in CKEditor.

<p><img alt="Testing Image" data-entity-type="file" data-entity-uuid="e78e041a-498e-4c33-a92a-15b59c6f0332" src="/sites/dev.dd/files/inline-images/sachin-suryavanshi3.jpg" /></p>

Thanks!

Rewted’s picture

Did a fresh clean install of Drupal 8, exact same result as reported. You're using Drupal 8?

Rewted’s picture

Same applies to regular links, they render like:

<a href="/terms-of-use">Terms of use</a> & <a href="/privacy">Privacy Policy</a>

VM’s picture

check the filters enabled on the text format in question. FULL HTML is simply a label. Insure the tags you are trying to utilize in the posts are included in the HTML filter.

Rewted’s picture

Nothing stands out.... unless I am misunderstanding something. Screenshot of the Text Format

VM’s picture

I'd enable the limit allowed HTML tags filter.

add the img and a tag (as well as any others) to the configuration.

test.

Rewted’s picture

Good idea. But unsuccessful. Tried adding these: <a href> <img src> <img> to both my migrated site and a fresh install of Drupal 8. So weird.

Follow-up. Added a link via CKEditor and it works, raw HTML in the same format does not. Looking at the page source it appears the < and > are replaced with &lt; and &gt;

Page source for links
<p>&lt;a href="domain.com"&gt;domain.com&lt;/a&gt;</p>
<p><a href="domain.com">domain.com</a></p>
VM’s picture

for future reference you wouldn't add <a href> <img src> Only the tag itself <a> <img>

https://www.drupal.org/node/1936392 =seems relevant ... found via https://www.drupal.org/node/1950498

Considering https://www.drupal.org/node/1936392 was marked fixed, it was included in the next release after the committed date. What is the exact version of Drupal in use and what version of the ckeditor library is in use?

Rewted’s picture

Isn't that an issue from 4 years ago?

My installation:

  • Drupal 8.2.6
  • CKEditor 8.2.6 (In core)
VM’s picture

the answer to your question is yes. However, I'm not sure what that has to do with someone else performing research for you when you hadn't stated the exact version of Drupal in use for anyone to know whether the 4 year old post was applicable. you are free to continue to research already existing issues. I don't utilize an editor to dig further. I suggest testing a new install to determine if the issue can be reproduced. If it can, I'd dig further into the core issue queue.

Rewted’s picture

I appreciate you taking the time to answer, let alone further research issues. However, your attitude is out of line. The initial post clearly indicates Drupal 8.x, also, the first comment suggested testing on a clean installation and my follow-up comment indicated a clean install of Drupal 8 was performed with same results. Your failure to acknowledge these is a problem within itself, don't fault people for your own mistakes. Thanks though.

VM’s picture

8.x is not an exact version. it just tells anyone reading what major version you're using. I requested it, so that it can be compared to the commit already linked issue. How is anyone to know you aren't using a pre-alpha release based on tagging a post 8.x ? neither your opening post or the comment you link to provide the requested level of specificity to aid in researching the 8.x.x issue queue. Hence why I asked.

I'm not sure what 'attitude' you're referring to or how anyone placed any 'fault' on you. I made simple statements. No specific tone was intended. However you can read it as you chose to. That's perfectly fine with me. I'll chalk your adverse reaction my comments as a misunderstanding rather than a temper tantrum for now.

Apologies for missing a comment that occurred before I joined the thread. It happens. It would have helped had you taken the time to state which install profile was utilized. Standard or minimal to insure anyone willing to spin up a fresh install could mimic your exact situation. If it can be reproduced, it may be a bug to be reported in the 8.x.x-dev issue queue after testing 8.x-dev to insure it hasn't already been fixed.

best of luck to you in your endeavors.

Rewted’s picture

In the past 22 minutes, you've modified your comment 19 times. Not sure what you're trying to accomplish with pushing the issue, but as I've already stated I appreciate you taking the time to help. I understand overlooking versions was an oversight on your part and lack of specific build on mine, but it is what it is. The issue remains in a clean installation of Drupal 8.2.6.

Most likely it is a legit bug in 8.2.6 as it's present in clean installation.

VM’s picture

There's an edit button, if it wasn't there I wouldn't use it. Turn off your notifications and you won't be bothered by my edits for clarity or elaboration.

Rewted’s picture

So I've figured out a work around. You need to hit the Source (turn on) button on the menu, enter your HTML and then click Source again (turn off), the HTML will then render properly. This is rather silly if by design, perhaps can anyone else confirm links or image tags work properly without this in their install?

VM’s picture

I don't see this as a bug. Spun up a -dev and tested both install profiles. enabling source to input HTML directly makes perfect sense to me. When not in source mode and the editor buttons are utilized there is no HTML except for that in the source. I suppose to provide a sense of live editing in the text area without having to read through the source itself. I venture you must have a reason as to why you are inputting source directly rather than utilizing the buttons provided by the editor.

Rewted’s picture

Once I discovered the Source button behavior, I was perplexed as to if this function was by design or error. To me, Full HTML would allow for direct input, but perhaps you are correct and this is intended function -- seeing as we now have two clean install confirmations. Thanks for your assistance.