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

svg-url-loader no importa correctamente <svg> en etiquetas <img> #1

Closed
temple opened this issue Apr 26, 2020 · 2 comments
Closed

svg-url-loader no importa correctamente <svg> en etiquetas <img> #1

temple opened this issue Apr 26, 2020 · 2 comments
Assignees
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@temple
Copy link
Member

temple commented Apr 26, 2020

El loader svg-url-loader, que se promueve como un sustituto mejorado del loader svg-inline-loader, no es capaz de procesar correctamente las referencias hacia archivos .svg dentro de etiquetas html, como sería el caso de <img src="xxx.svg" />.

Si se hace un build del proyecto situado en el commit #2b81598 se puede ver como en el archivo dist/index.html el valor del atributo src para la etiqueta <img> no es válido, por no estar rodeado de comitas ".

@temple temple changed the title svg-url-loader falla amb els html svg-url-loader no sustituye <img src> por <svg> Apr 27, 2020
@temple temple changed the title svg-url-loader no sustituye <img src> por <svg> svg-url-loader no importa correctamente <svg> en etiquetas <img> Apr 27, 2020
@temple
Copy link
Member Author

temple commented Apr 27, 2020

Si analizamos este comentario introducido en el issue #126 de svg-url-loader, nos damos cuenta de que la problemática es originada por html-loader, que elimina las comillas dobles de aquellos atributos univaluados.

@temple
Copy link
Member Author

temple commented Apr 27, 2020

Como se apunta en este otro comentario se puede impedir que html-loader elimine las dobles comillas, poniendo removeAttributeQuotes a false.

@temple temple added bug Something isn't working question Further information is requested labels Apr 27, 2020
@temple temple added this to the Inline svgs milestone Apr 27, 2020
@temple temple self-assigned this Apr 27, 2020
@temple temple added this to In progress in Webpack Lessons Apr 27, 2020
@temple temple closed this as completed in 034c071 Apr 27, 2020
Webpack Lessons automation moved this from In progress to Done Apr 27, 2020
temple added a commit that referenced this issue May 1, 2020
temple added a commit that referenced this issue May 1, 2020
temple added a commit that referenced this issue May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
Development

No branches or pull requests

1 participant