mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 16:47:26 +02:00
fix(utils): make SVGO not remove title (#6684)
* chore(utils): add `removeTitle: false` to svg loader By default, SVGR removes the `<title>` tag from SVG inputs. This hinders a11y since "the `<title>` element provides an accessible, short-text description of any SVG container element or graphics element". Modern browsers also show tooltips on hover for inline SVG with the `<title>` tag. See https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title * fix test
This commit is contained in:
parent
94532dfd26
commit
0c6165b161
2 changed files with 3 additions and 1 deletions
|
@ -8,7 +8,7 @@
|
|||
import {getFileLoaderUtils} from '../webpackUtils';
|
||||
|
||||
describe('getFileLoaderUtils()', () => {
|
||||
test('plugin svgo/removeViewBox should be disabled', () => {
|
||||
test('plugin svgo/removeViewBox and removeTitle should be disabled', () => {
|
||||
const {oneOf} = getFileLoaderUtils().rules.svg();
|
||||
expect(oneOf[0].use).toContainEqual(
|
||||
expect.objectContaining({
|
||||
|
@ -20,6 +20,7 @@ describe('getFileLoaderUtils()', () => {
|
|||
name: 'preset-default',
|
||||
params: {
|
||||
overrides: {
|
||||
removeTitle: false,
|
||||
removeViewBox: false,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -112,6 +112,7 @@ export function getFileLoaderUtils(): FileLoaderUtils {
|
|||
name: 'preset-default',
|
||||
params: {
|
||||
overrides: {
|
||||
removeTitle: false,
|
||||
removeViewBox: false,
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue