gbif / hp-living-norway

Living Norway Ecological Data Network is facilitating FAIR management of ecological data to the benefit of society and science; https://livingnorway.no/
1 stars 0 forks source link

</source> tag without <source> #37

Open frafra opened 1 year ago

frafra commented 1 year ago

Describe the bug </source> without <source>

To Reproduce Steps to reproduce the behavior:

  1. Go to (data.livingnorway.no)[https://data.livingnorway.no] homepage
  2. Look at the source code

Expected behavior HTML should not have closing tags without a corresponding opening tag.

Additional context There is no occurrence of </source> in this repository, so I am not sure where it could come from.

MortenHofft commented 1 year ago

That sounds like something I have caused. I've mistakenly wrapped image tags in source tags. I will move the issue to the hosted portals repo as this isn't specific to your site. Thank you for noticing it.

MortenHofft commented 1 year ago

I took me along time to figure out what the cause of this was. But I see you have added a custom plugin gem 'jekyll-target-blank' - if you remove that then it works. For some reason that plugin rewrites the html and adds closing tags to the source element which is illegal. I will move this issue back to Living Norway.

If you believe that this is an issue with the theme, then let me know what I can do to help.

frafra commented 1 year ago

I cannot see these tags locally with the latest master version. The updated gemfile just removed jekyll-analytics. I am not sure if it has been fixed somewhere. I see no opening or closing source tags.

MortenHofft commented 1 year ago

Be aware that local and production use different html for images as the prod version goes through our Thumbor service for image scaling.

frafra commented 1 year ago

Oh, ok. Is there any way to test a branch then?

MortenHofft commented 1 year ago

This is the code that inserts the source tag https://github.com/gbif/jekyll-hp-base-theme/blob/master/_includes/blocks/parts/featureImage.html#L12

But I expect that plugin you had installed will fiddle with any html. So I would think you could just insert a picture tag with a source tag and then it will rewrite it (wrongly so). E.g. adding below in a markdown file locally as a test.

<picture>
    <source type="image/jpeg" srcset="https://api.gbif.org/v1/image/JlTKWXQhf_RFNO6cs_i-VOFzrFc=/fit-in/2000x0/filters:format(jpeg)/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 2000w, 
                    https://api.gbif.org/v1/image/_wUg-mt_o5wmdDIhvZINcPn7gBY=/fit-in/1600x0/filters:format(jpeg)/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 1600w, 
                    https://api.gbif.org/v1/image/fYeRGTYTkm0PclXZi-W9OdRYttk=/fit-in/1200x0/filters:format(jpeg)/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 1200w, 
                    https://api.gbif.org/v1/image/bOu9pVLxzcczpj-jOhq3PO5mm-g=/fit-in/1000x0/filters:format(jpeg)/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 1000w, 
                    https://api.gbif.org/v1/image/qBGABcdftf6sP7jvZRgthH5hGi4=/fit-in/800x0/filters:format(jpeg)/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 800w, 
                    https://api.gbif.org/v1/image/jx6BcMv8cKXaY6SUuH6A62ixSNk=/fit-in/500x0/filters:format(jpeg)/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 500w,
                    https://api.gbif.org/v1/image/QwAHQAtaQJJC2ajatbOEirYJ7YM=/fit-in/10x0/filters:format(jpeg)/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 10w">
  <img src="https://hp-base-theme.gbif-staging.org/assets/img/Haeckel_Siphoneae.jpg" srcset="https://api.gbif.org/v1/image/dShY6Lz6GzDfi7hTOGX5Dx-OFY8=/fit-in/2000x0/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 2000w, 
                https://api.gbif.org/v1/image/fjGTQKrC6hR1U5MC2Dy_JTWWNoc=/fit-in/1600x0/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 1600w, 
                https://api.gbif.org/v1/image/nSe88omI_jFBmhxj4ktGlVaUAxU=/fit-in/1200x0/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 1200w, 
                https://api.gbif.org/v1/image/QW4co-J6AwgtCyw9qeDZDgoZlKc=/fit-in/1000x0/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 1000w, 
                https://api.gbif.org/v1/image/2RE8IKGK3pxM84BZqOj9C-_AlIU=/fit-in/800x0/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 800w, 
                https://api.gbif.org/v1/image/DuctNoMPf56a_ahHYZEjiPlQCIc=/fit-in/500x0/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 500w,
                https://api.gbif.org/v1/image/-AVoFHA62APsKtWksSE3HnD32Uc=/fit-in/10x0/https%3A%2F%2Fhp-base-theme.gbif-staging.org%2Fassets%2Fimg%2FHaeckel_Siphoneae.jpg 10w">
</picture>