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

Cyrillic is replaced #2

Closed
axperien opened this issue Aug 8, 2018 · 5 comments
Closed

Cyrillic is replaced #2

axperien opened this issue Aug 8, 2018 · 5 comments
Labels

Comments

@axperien
Copy link

axperien commented Aug 8, 2018

Hi!
Thanks for the plugin!
There is a small problem. Cyrillic in the file is replaced with unicode.

<span>Узнай о нас больше</span>

<span>&#x423;&#x437;&#x43D;&#x430;&#x439; &#x43E; &#x43D;&#x430;&#x441; &#x431;&#x43E;&#x43B;&#x44C;&#x448;&#x435;</span>

How can this be avoided?

@haensl
Copy link
Owner

haensl commented Aug 8, 2018

Hi axperien,

first of all: thanks for reporting this issue!

Can you maybe provide me with a sample setup? E.g. some HTML and gulp task you used?
That would make it easier for me to reproduce the issue.

@haensl haensl added the bug label Aug 8, 2018
@axperien
Copy link
Author

axperien commented Aug 9, 2018

Yes. Here is an example.
After changing the file using the plugin, my problem occurs.

gulp.task('svgEmbed', function () {
    gulp.src(defaultPath.src.html)
        .pipe(embedSvg({
            root: './dist',
            selectors: '.svg'
        }))
        .pipe(gulp.dest(defaultPath.build.html))
});

<img src="./images/home_icon.svg" class="svg" alt="" />

@haensl
Copy link
Owner

haensl commented Aug 12, 2018

I found out that this was caused by htmlparser2's option decodeEntities via cheerio's $.html which defaults this to true.
I therefore published a new version which adds the decodeEntities parameter, which defaults to false and therefore fixes your problem. If you ever want to encode decoded html entities, set it to true.

Please use the latest version and let me know if you still have experience any problems.

@haensl
Copy link
Owner

haensl commented Aug 12, 2018

Fixed in v1.0.1

@haensl haensl closed this as completed Aug 12, 2018
@axperien
Copy link
Author

Yes, it fixed my problem. Thank you

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