Giter VIP home page Giter VIP logo

Comments (7)

kgram avatar kgram commented on May 29, 2024 1

@alex-shamshurin: just a little ping, if you can describe in more detail what the problem is, I'd be happy to take a look at it.

from svg-url-loader.

EECOLOR avatar EECOLOR commented on May 29, 2024

If you look at the source code, it has an additional requirement: your content needs to have a style tag.

from svg-url-loader.

alex-shamshurin avatar alex-shamshurin commented on May 29, 2024

No matter, IE11 does not work with SVG class too. It must not be inlined to support IE11. This option should fix it without other conditions.

from svg-url-loader.

bhovhannes avatar bhovhannes commented on May 29, 2024

@kgram, as an author of iesafe option, do you have any thoughts on this?

from svg-url-loader.

kgram avatar kgram commented on May 29, 2024

@alex-shamshurin: I don't understand what aspect of classes you would expect to work without a style-tag. Is the problem internal references to masks or something?

I wasn't aware of any broken features besides style-tags, so I made a check to avoid unnecessary bailouts. In my defense, I did document it under the option description ("[..]if the file contains a style-element and the encoded size is above 4kB[..]"). Can you possibly post an example of an SVG that doesn't work (possibly with path-data removed if it's sensitive, hopefully the problem will still be visible)? It's possible the style-tag check should just be removed to be completely safe.

from svg-url-loader.

shikelong avatar shikelong commented on May 29, 2024

leyserPlusLogo.zip

hi, @kgram The svg has style tag, but in ie11, it's has been convert to inline data-url svg and only has black color. I expect it fallback to fileloader.

The loader option:

{
        test: /\.(svg)$/,
        use: [{
          loader: 'svg-url-loader',
          options: {
            limit: 10000,
            iesafe: true,
            encoding: 'base64'
          }
        }]
      },

Regards.

from svg-url-loader.

kgram avatar kgram commented on May 29, 2024

I had expected some sort of weird IE behaviour when using base64, but it turned out to be plain stupidity from myself. When I wrote the feature I forgot that . in regex does't match line breaks. All my generated examples are without extra whitespace and everywhere I use the loader myself I have it placed after an optimiser that strips the extra whitespace, so I've never noticed it.

I'm sorry for any trouble my oversight has caused. The good news is that until a new release is ready the problem should be fixable by placing an optimiser-loader such as svgo-loader before the svg-url-loader.

from svg-url-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.