Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

img tag is converted to invalid xml #69

Open
KjellMorgenstern opened this issue Dec 12, 2021 · 5 comments
Open

img tag is converted to invalid xml #69

KjellMorgenstern opened this issue Dec 12, 2021 · 5 comments
Assignees
Labels
bug Something isn't working verified This issue was already verified

Comments

@KjellMorgenstern
Copy link

KjellMorgenstern commented Dec 12, 2021

In my document I have image tags like
<img src="someimage.png"/>

As soon as I include the spaceship gem, the tags are converted to

<img src="someimage.png">

The "/" at the end is removed.
This is not valid xhtml anymore and breaks some parsers.

@jeffreytse jeffreytse self-assigned this Dec 12, 2021
@jeffreytse jeffreytse added bug Something isn't working verified This issue was already verified labels Dec 12, 2021
@jeffreytse
Copy link
Owner

Hi @KjellMorgenstern

I just tried, and it still keeps converting to an unclosed tag without spaceship, could you have a try in your side?

Thanks and Regards

@KjellMorgenstern
Copy link
Author

There are multiple thumbnail gems, maybe that is why it looks different for you.
See https://github.com/superterran/jekyll-thumbnail/blob/master/lib/jekyll-thumbnail.rb , line 67. This generates a closed image tag.

@jeffreytse
Copy link
Owner

Hi @KjellMorgenstern

Thanks for your information, is it that I need to install this gem to reproduce the issue?

Thanks and Regards

@KjellMorgenstern
Copy link
Author

KjellMorgenstern commented Dec 13, 2021

Kramdown itself inserts an end slashes for images (and other elements):
https://github.com/gettalong/kramdown/blob/master/lib/kramdown/converter/html.rb#L276

However, only when I use the jekyll-thumbnail gem, without the spaceship gem, I get the desired closed img tags:

I tried to add
<img src="test.png"/>
directly in a post, and it was converted to
<img src="test.png">
without the spaceship gem.

So, yes, the thumbnail gem is needed to reproduce this.

@jeffreytse
Copy link
Owner

@KjellMorgenstern I know what you mean, let me have a check and find a solution. Thank you! : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working verified This issue was already verified
Projects
None yet
Development

No branches or pull requests

2 participants