boopathi/react-svg-loader

Svg <title> goes missing!

OZZlE opened this issue · 5 comments

OZZlE commented

Hi, we where doing like this in html - the output used to be:

<h1>
    <svg>
        <title>Page title</title>
        <path>...</path>
    </svg>
</h1>

However after we updated from version 2.1.0 to 3.0.1 it removes the <title> tag! As you can probably understand this is very bad for SEO as well as usability/screen-readers! We updated because node was reporting security vulnerabilities.

Skärmklipp 2019-07-03 10 36 39
Skärmklipp 2019-07-03 10 37 09
Skärmklipp 2019-07-03 10 37 51

but after the upgrade the <title> is no longer there...!
Skärmklipp 2019-07-03 10 48 30

OZZlE commented

What's the rationale for removing it? In our case it's just a hardcoded string.. so you can't say that it's a security vulnerability

OZZlE commented

I saw now that you have an option to keep it

options: {
    svgo: {
        plugins: [
            { removeTitle: false }
        ],
    }
}

still wondering about the rationale though.. wasn't a nice surprise upgrading

OZZlE commented

But now I am stuck with (as ukrainians say (I am not)) 'the next problem' https://stackoverflow.com/questions/56882319/webpack-3-how-do-i-add-options-to-a-chained-loader ....

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

OZZlE commented
{
  test: /\.svg$/,
  use: [
    "babel-loader",
    {
      loader: "react-svg-loader",
      options: {
        svgo: {
          plugins: [
            { removeTitle: false }
          ],
        },
      },
    },
  ],
},