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

Something works wrong #16

Closed
medzhidov opened this issue May 7, 2019 · 2 comments
Closed

Something works wrong #16

medzhidov opened this issue May 7, 2019 · 2 comments
Labels

Comments

@medzhidov
Copy link

It cuts all after svg embed.

Before:

image

After:

image

Gulp:

image

@medzhidov
Copy link
Author

It tries to find closing tag. If i use paired tag (svg or [omg] img as a paired tag), all works fine.

@haensl
Copy link
Owner

haensl commented May 14, 2019

Hi!

Thank you for reporting this issue. The behaviour you observe is indeed the result of feeding the non-closed <img> tag to htmlparser2 with the xmlMode option deployed. We use xmlMode in gulp-embed-svg in order to parse various SVG attributes, tags and properties correctly.

Once you adjust your image tag to close, your code will work, e.g. change line 36 in your source file to

<img src="./img/icons/icon.svg" alt="" /> <!-- Notice the closing slash -->

your code should work fine.

I have created a pull request introducing unit tests to verify that self-closing and non-closing img tags work.. Please go ahead and check it out.

@haensl haensl added the wontfix label May 16, 2019
@haensl haensl closed this as completed May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants